alpine/Dockerfile

21 lines
619 B
Docker
Raw Normal View History

2018-11-25 21:25:08 +00:00
FROM alpine as build
2019-01-30 18:50:13 +00:00
ARG VERSION
2019-12-19 16:33:59 +00:00
ENV ALPINE_SERIES 3.11
2019-01-30 18:50:13 +00:00
ENV ALPINE_MIRROR https://uk.alpinelinux.org/alpine/v${ALPINE_SERIES}
2018-11-22 12:14:28 +00:00
ENV ALPINE_ARCH x86_64
2019-01-30 18:50:13 +00:00
2018-11-25 21:25:08 +00:00
WORKDIR /root
2019-01-30 18:50:13 +00:00
RUN set -x; apk add --no-cache curl &&\
curl -LO ${ALPINE_MIRROR}/releases/${ALPINE_ARCH}/alpine-minirootfs-${VERSION}-${ALPINE_ARCH}.tar.gz &&\
2018-11-25 21:25:08 +00:00
mkdir /dest &&\
2019-01-30 18:50:13 +00:00
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
2018-11-25 21:25:08 +00:00
FROM scratch
2019-11-16 15:20:24 +00:00
ARG VERSION
LABEL version.alpine=$VERSION
2018-11-25 21:25:08 +00:00
COPY --from=build /dest /
2018-11-22 12:14:28 +00:00
CMD ["/bin/sh"]
2019-11-16 15:20:24 +00:00