diff --git a/test/pkg/virtsock/Dockerfile b/test/pkg/virtsock/Dockerfile index 7e62b6567..cb7c07952 100644 --- a/test/pkg/virtsock/Dockerfile +++ b/test/pkg/virtsock/Dockerfile @@ -1,4 +1,10 @@ -FROM linuxkit/go-compile:4513068d9a7e919e4ec42e2d7ee879ff5b95b7f5@sha256:bdfadbe3e4ec699ca45b67453662321ec270f2d1a1dbdbf09625776d3ebd68c5 AS virtsock-build +FROM linuxkit/alpine:dae8bcbc6e2cec0a1cc1958dddbc5d6bd3ccf9a0@sha256:02c251d54c4083a596ead8cae92144306b385db0ff961c95a3a620a4c69961ed AS mirror +RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/ +RUN apk add --no-cache --initdb -p /out \ + tini +RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache + +FROM linuxkit/go-compile:4513068d9a7e919e4ec42e2d7ee879ff5b95b7f5@sha256:bdfadbe3e4ec699ca45b67453662321ec270f2d1a1dbdbf09625776d3ebd68c5 AS build ENV VIRTSOCK_COMMIT=3bfdf22e3b63a7d130ae5db41c2d76eaffa444d4 RUN mkdir -p $GOPATH/src/github.com/rneugeba && \ @@ -9,6 +15,7 @@ RUN git checkout $VIRTSOCK_COMMIT RUN make build/virtsock_stress.linux RUN cp -a build/virtsock_stress.linux /virtsock_stress -FROM linuxkit/tini:cb32c9b3ceb16505e1d62919cf28c8b52bf6d57e@sha256:1645296b3e155f8cf672f71f8d20b274bf38ee94c39dd1b58f7b18e0163b00b8 -COPY --from=virtsock-build virtsock_stress bin/virtsock_stress -CMD ["/bin/tini", "/bin/virtsock_stress", "-s", "-v", "1"] +FROM scratch +COPY --from=mirror /out/ / +COPY --from=build virtsock_stress bin/virtsock_stress +CMD ["/sbin/tini", "/bin/virtsock_stress", "-s", "-v", "1"] diff --git a/test/pkg/virtsock/Makefile b/test/pkg/virtsock/Makefile index 69278eba1..18d54480b 100644 --- a/test/pkg/virtsock/Makefile +++ b/test/pkg/virtsock/Makefile @@ -1,14 +1,15 @@ .PHONY: tag push default: push +ORG?=linuxkit IMAGE=test-virtsock DEPS=Dockerfile Makefile HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}') tag: $(DEPS) - docker build --no-cache -t linuxkit/$(IMAGE):$(HASH) . + docker build --squash --no-cache -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)