use configured mirror for apk repository

This commit is contained in:
chris 2018-11-28 12:12:17 +01:00
parent fd728c2f69
commit 8119dd031f
1 changed files with 4 additions and 3 deletions

View File

@ -1,12 +1,13 @@
FROM alpine as build
ENV ALPINE_MIRROR https://uk.alpinelinux.org/alpine/v3.8/releases
ENV ALPINE_MIRROR https://uk.alpinelinux.org/alpine/v3.8
ENV ALPINE_VERSION 3.8.1
ENV ALPINE_ARCH x86_64
WORKDIR /root
RUN apk add --no-cache curl &&\
curl -LO ${ALPINE_MIRROR}/${ALPINE_ARCH}/alpine-minirootfs-${ALPINE_VERSION}-${ALPINE_ARCH}.tar.gz &&\
curl -LO ${ALPINE_MIRROR}/releases/${ALPINE_ARCH}/alpine-minirootfs-${ALPINE_VERSION}-${ALPINE_ARCH}.tar.gz &&\
mkdir /dest &&\
tar -C /dest -xvzf alpine-minirootfs-${ALPINE_VERSION}-${ALPINE_ARCH}.tar.gz
tar -C /dest -xvzf alpine-minirootfs-${ALPINE_VERSION}-${ALPINE_ARCH}.tar.gz &&\
sed -i "s#http://dl-cdn.alpinelinux.org/alpine/v3.8#${ALPINE_MIRROR}#g" /dest/etc/apk/repositories
FROM scratch
COPY --from=build /dest /