Skip to content

Commit 6c5cfc3

Browse files
committed
Make build prefix configurable in the Dockerfile
Allows passing --build-arg=/some/prefix to cmake when building the image. The immediate need will be in the next commit, but there are other potential uses like building an actual system rpm in the image (ie with the original prefix) or randomizing the prefix to make sure no hardcoded assumptions end up in the tests etc.
1 parent 716e40f commit 6c5cfc3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/Dockerfile.fedora

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ARG PREFIX=/usr/local
2+
13
# Supported Fedora releases: 40 41
24
FROM registry.fedoraproject.org/fedora:41 AS base
35
@@ -88,6 +90,7 @@ WORKDIR /
8890
CMD /bin/bash
8991

9092
FROM base AS full
93+
ARG PREFIX
9194

9295
WORKDIR /srv/rpm
9396
COPY . .
@@ -106,6 +109,7 @@ RUN cmake \
106109
-DWITH_DOXYGEN=ON \
107110
-DENABLE_TESTSUITE=ON \
108111
-DMKTREE_BACKEND=rootfs \
112+
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
109113
../rpm
110114
RUN make -j$(nproc) tree
111115

tests/mktree.oci

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ else
2626
fi
2727

2828
IMAGE=rpm
29-
ARGS="-f Dockerfile $FROM $CONTEXT"
29+
ARGS="-f Dockerfile $FROM $CONTEXT "
3030
ROOTLESS=$([ $(id -u) == 0 ] && echo 0 || echo 1)
3131
CMD=$1; shift
3232

0 commit comments

Comments
 (0)