Merge pull request #1781 from AkihiroSuda/arg-alpine-version

Dockerfile: use ARG for Alpine version
v0.8
Akihiro Suda 2020-11-12 12:54:50 +09:00 committed by GitHub
commit bad541623d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -14,6 +14,10 @@ ARG SHADOW_VERSION=4.8.1
ARG FUSEOVERLAYFS_VERSION=v1.2.0
ARG STARGZ_SNAPSHOTTER_VERSION=3a04e4c2c116c85b4b66d01945cf7ebcb7a2eb5a
ARG ALPINE_VERSION=3.12
FROM alpine:${ALPINE_VERSION} AS alpine
# git stage is used for checking out remote repository sources
FROM --platform=$BUILDPLATFORM alpine AS git
RUN apk add --no-cache git xz
@ -267,7 +271,7 @@ VOLUME /var/lib/buildkit
# newuidmap & newgidmap binaries (shadow-uidmap 4.7-r1) shipped with alpine cannot be executed without CAP_SYS_ADMIN,
# because the binaries are built without libcap-dev.
# So we need to build the binaries with libcap enabled.
FROM alpine:3.12 AS idmap
FROM alpine AS idmap
RUN apk add --no-cache autoconf automake build-base byacc gettext gettext-dev gcc git libcap-dev libtool libxslt
RUN git clone https://github.com/shadow-maint/shadow.git /shadow
WORKDIR /shadow
@ -278,7 +282,7 @@ RUN ./autogen.sh --disable-nls --disable-man --without-audit --without-selinux -
&& cp src/newuidmap src/newgidmap /usr/bin
# Rootless mode.
FROM alpine:3.12 AS rootless
FROM alpine AS rootless
RUN apk add --no-cache fuse3 git xz
COPY --from=idmap /usr/bin/newuidmap /usr/bin/newuidmap
COPY --from=idmap /usr/bin/newgidmap /usr/bin/newgidmap