diff --git a/pkg/mount/Dockerfile b/pkg/mount/Dockerfile index bacf65255..e9189b4f3 100644 --- a/pkg/mount/Dockerfile +++ b/pkg/mount/Dockerfile @@ -1,15 +1,19 @@ -FROM linuxkit/alpine:c5021a113803f7608e3908014d316c3490183d0b@sha256:4c7a80173c71ca5019dc56f40442b3a8345f141dd46593bd1fe6d130294d07cb AS mirror +FROM linuxkit/alpine:6336329f15b4166514782eaa555cf0ffd35c519c@sha256:f6c2ce92910b1d6e4e5557850a554f4a3ae9f66c1e89ad86a24d6c6e550f165e AS mirror -FROM alpine:3.5@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8 -COPY --from=mirror /etc/apk/repositories /etc/apk/repositories -COPY --from=mirror /etc/apk/keys /etc/apk/keys/ -COPY --from=mirror /mirror /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 \ + jq \ + musl \ + sfdisk \ + && true +RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache -RUN apk add --no-cache \ - jq \ - sfdisk \ - && true -RUN rm -rf /mirror /etc/apk/repositories /etc/apk/keys - -COPY . ./ +FROM scratch +ENTRYPOINT [] +CMD [] +WORKDIR / +COPY --from=mirror /out/ / +COPY mount.sh / CMD ["/bin/sh", "/mount.sh"] diff --git a/pkg/mount/Makefile b/pkg/mount/Makefile index ac3a79cd7..1f37b206f 100644 --- a/pkg/mount/Makefile +++ b/pkg/mount/Makefile @@ -1,14 +1,15 @@ .PHONY: tag push default: push +ORG?=linuxkit IMAGE=mount DEPS=Dockerfile mount.sh HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}') tag: $(DEPS) - docker build --squash --no-cache --network=none -t linuxkit/$(IMAGE):$(HASH) . + docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) . push: tag - docker pull linuxkit/$(IMAGE):$(HASH) || \ - docker push linuxkit/$(IMAGE):$(HASH) + docker pull $(ORG)/$(IMAGE):$(HASH) || \ + docker push $(ORG)/$(IMAGE):$(HASH)