FROM linuxkit/alpine:3683c9a66cd4da40bd7d6c7da599b2dcd738b559 AS mirror RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/ RUN apk add --no-cache --initdb -p /out \ alpine-baselayout \ busybox \ musl \ sfdisk \ && true RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache FROM linuxkit/alpine:3683c9a66cd4da40bd7d6c7da599b2dcd738b559 AS build RUN apk add --no-cache go musl-dev ENV GOPATH=/go PATH=$PATH:/go/bin COPY *.go /go/src/mountie/ RUN go-compile.sh /go/src/mountie FROM scratch ENTRYPOINT [] CMD [] WORKDIR / COPY --from=mirror /out/ / COPY --from=build /go/bin/mountie usr/bin/mountie CMD ["/usr/bin/mountie"]