diff --git a/base/tini/Makefile b/base/tini/Makefile deleted file mode 100644 index fd54768a4..000000000 --- a/base/tini/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -.PHONY: tag push - -BASE=alpine:3.5 -IMAGE=tini - -default: push - -hash: Dockerfile - DOCKER_CONTENT_TRUST=1 docker pull $(BASE) - tar cf - $^ | docker build --no-cache -t $(IMAGE):build - - docker run --rm --entrypoint sh $(IMAGE):build -c 'cat /Dockerfile /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash - -push: hash - docker pull linuxkit/$(IMAGE):$(shell cat hash) || \ - (docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) && \ - docker push linuxkit/$(IMAGE):$(shell cat hash)) - docker rmi $(IMAGE):build - rm -f hash - -tag: hash - docker pull linuxkit/$(IMAGE):$(shell cat hash) || \ - docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) - docker rmi $(IMAGE):build - rm -f hash - -clean: - rm -f hash - -.DELETE_ON_ERROR: diff --git a/base/rng-tools/fix-textrels-on-PIC-x86.patch b/pkg/rngd/fix-textrels-on-PIC-x86.patch similarity index 90% rename from base/rng-tools/fix-textrels-on-PIC-x86.patch rename to pkg/rngd/fix-textrels-on-PIC-x86.patch index 88d0a7f90..7ea76d6fd 100644 --- a/base/rng-tools/fix-textrels-on-PIC-x86.patch +++ b/pkg/rngd/fix-textrels-on-PIC-x86.patch @@ -1,17 +1,17 @@ --- rng-tools/rdrand_asm.S +++ rng-tools/rdrand_asm.S @@ -49,6 +49,7 @@ - ret + ret ENDPROC(x86_rdrand_nlong) - + +#define INIT_PIC() #define SETPTR(var,ptr) leaq var(%rip),ptr #define PTR0 %rdi #define PTR1 %rsi @@ -84,7 +85,16 @@ - ret + ret ENDPROC(x86_rdrand_nlong) - + +#if defined(__PIC__) +#undef __i686 /* gcc builtin define gets in our way */ +#define INIT_PIC() \ @@ -26,16 +26,16 @@ #define PTR1 %edx #define PTR2 %ecx @@ -101,6 +111,7 @@ - movl 8(%ebp), %eax - movl 12(%ebp), %edx + movl 8(%ebp), %eax + movl 12(%ebp), %edx #endif + INIT_PIC() - - SETPTR(aes_round_keys, PTR2) - + + SETPTR(aes_round_keys, PTR2) + @@ -166,6 +177,17 @@ #endif - ret + ret ENDPROC(x86_aes_mangle) + +#if defined(__i386__) && defined(__PIC__) diff --git a/base/rng-tools/sha256sums b/pkg/rngd/sha256sums similarity index 100% rename from base/rng-tools/sha256sums rename to pkg/rngd/sha256sums diff --git a/test/virtsock/Dockerfile.build b/test/virtsock/Dockerfile.build deleted file mode 100644 index 463221e89..000000000 --- a/test/virtsock/Dockerfile.build +++ /dev/null @@ -1,11 +0,0 @@ -FROM linuxkit/go-compile:4513068d9a7e919e4ec42e2d7ee879ff5b95b7f5@sha256:bdfadbe3e4ec699ca45b67453662321ec270f2d1a1dbdbf09625776d3ebd68c5 - -ENV VIRTSOCK_COMMIT=6b4dec728264e07c41e108caebd6bc2b72559a5f -RUN mkdir -p $GOPATH/src/github.com/rneugeba && \ - cd $GOPATH/src/github.com/rneugeba && \ - git clone https://github.com/rneugeba/virtsock.git -WORKDIR $GOPATH/src/github.com/rneugeba/virtsock -RUN git checkout $VIRTSOCK_COMMIT -RUN make build/virtsock_stress.linux - -ENTRYPOINT ["cat", "build/virtsock_stress.linux"] diff --git a/test/virtsock/Dockerfile.pkg b/test/virtsock/Dockerfile.pkg deleted file mode 100644 index 2f25a302a..000000000 --- a/test/virtsock/Dockerfile.pkg +++ /dev/null @@ -1,3 +0,0 @@ -FROM scratch -COPY . ./ -CMD ["/bin/tini", "/bin/virtsock_stress", "-s", "-v", "1"] diff --git a/base/tini/Dockerfile b/tools/tini/Dockerfile similarity index 52% rename from base/tini/Dockerfile rename to tools/tini/Dockerfile index 3d520b1d5..8250d6c7e 100644 --- a/base/tini/Dockerfile +++ b/tools/tini/Dockerfile @@ -1,16 +1,13 @@ -FROM alpine:3.5 -RUN \ - apk update && apk upgrade && \ - apk add \ - cmake \ - gcc \ - make \ - musl-dev \ - vim \ - && true - +FROM linuxkit/c-compile:f52f485825c890d581e82a62af6906c1d33d8e5d@sha256:473fd283a090d3546e93915adacf00c69a23ff615c95c968c4a40e8723985853 AS tini-build COPY . / ENV TINI_VERSION=0.13.0 ADD https://github.com/krallin/tini/archive/v${TINI_VERSION}.tar.gz tini-${TINI_VERSION}.tar.gz + RUN zcat tini-${TINI_VERSION}.tar.gz | tar xvf - RUN cd tini-${TINI_VERSION} && cmake . && make && cp -a tini-static /bin/tini + +FROM scratch +ENTRYPOINT [] +CMD [] +WORKDIR / +COPY --from=tini-build bin/tini bin/tini diff --git a/tools/tini/Makefile b/tools/tini/Makefile new file mode 100644 index 000000000..adacde647 --- /dev/null +++ b/tools/tini/Makefile @@ -0,0 +1,26 @@ +.PHONY: tag push +default: push + +IMAGE=tini +SHA_IMAGE=alpine:3.5@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8 +DEPS=Dockerfile Makefile + +hash: $(DEPS) + find $^ -type f | xargs cat | docker run --rm -i $(SHA_IMAGE) sha1sum - | sed 's/ .*//' > hash + +tag: hash + docker pull linuxkit/$(IMAGE):$(shell cat hash) || \ + (docker build --no-cache -t $(IMAGE):build . && \ + docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash)) + +push: tag + docker pull linuxkit/$(IMAGE):$(shell cat hash) || \ + docker push linuxkit/$(IMAGE):$(shell cat hash) + rm -f hash + docker rmi $(IMAGE):build || true + +clean: + rm -f hash + docker rmi $(IMAGE):build || true + +.DELETE_ON_ERROR: diff --git a/tools/tini/README.md b/tools/tini/README.md new file mode 100644 index 000000000..fc3425e95 --- /dev/null +++ b/tools/tini/README.md @@ -0,0 +1,4 @@ +[tini](https://github.com/krallin/tini) is a tiny program which can be +used as a minimal `init` process for container images. + +The `linuxkit/tini` image just contains `/bin/tini` and can be used as the base image by packages, requiring `tini`.