Skip to content

Commit cefe79a

Browse files
committed
Run mkimage.sh as non-root user
Alpine 3.23 ships apk-tools 3.0 which deprecated --no-chown as an alias for --usermode. The --usermode flag cannot be used as root, breaking the previous root-based build. Switch to running the build as a dedicated "build" user, which is the intended way to use mkimage.sh with the --no-chown flag. Signed-off-by: Jan Dubois <jan.dubois@suse.com>
1 parent 296b389 commit cefe79a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ RUN if [ "${TARGETARCH}" = "amd64" ]; then apk add syslinux; fi
1414

1515
COPY --from=binfmt /usr/bin /binfmt
1616

17-
RUN addgroup root abuild
18-
RUN abuild-keygen -i -a -n
1917
RUN apk update
18+
RUN adduser -D build && addgroup build abuild
19+
USER build
20+
RUN abuild-keygen -a -n
2021

21-
ADD src/aports /home/build/aports
22+
ADD --chown=build:build src/aports /home/build/aports
2223
WORKDIR /home/build/aports/scripts
2324
ENTRYPOINT ["sh", "./mkimage.sh"]

build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ ${DOCKER} run --rm \
2727
--tag "${TAG}" \
2828
--outdir /iso \
2929
--arch "${ARCH}" \
30-
--repository "/home/build/packages/lima" \
3130
--repository "http://dl-cdn.alpinelinux.org/alpine/${REPO_VERSION}/main" \
3231
--repository "http://dl-cdn.alpinelinux.org/alpine/${REPO_VERSION}/community" \
3332
--profile lima

0 commit comments

Comments
 (0)