alpine/Dockerfile
2020-05-23 16:36:39 +02:00

17 lines
575 B
Docker

FROM alpine as build
ARG VERSION
ENV ALPINE_SERIES 3.9
ENV ALPINE_MIRROR https://uk.alpinelinux.org/alpine/v${ALPINE_SERIES}
ENV ALPINE_ARCH x86_64
WORKDIR /root
RUN set -x; apk add --no-cache curl &&\
curl -LO ${ALPINE_MIRROR}/releases/${ALPINE_ARCH}/alpine-minirootfs-${VERSION}-${ALPINE_ARCH}.tar.gz &&\
mkdir /dest &&\
tar -C /dest -xvzf alpine-minirootfs-${VERSION}-${ALPINE_ARCH}.tar.gz &&\
sed -i "s#http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_SERIES}#${ALPINE_MIRROR}#g" /dest/etc/apk/repositories
FROM scratch
COPY --from=build /dest /
CMD ["/bin/sh"]