pkg: Use tini from alpine base in rngd

This makes the package slightly bigger as tini from Alpine
is not statically linked but removes the dependency on
./tools/tini

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2017-05-18 17:22:45 +01:00
parent e950d6e2ac
commit ab5bb75642
2 changed files with 12 additions and 10 deletions

View File

@ -1,4 +1,11 @@
FROM linuxkit/alpine:6336329f15b4166514782eaa555cf0ffd35c519c@sha256:f6c2ce92910b1d6e4e5557850a554f4a3ae9f66c1e89ad86a24d6c6e550f165e AS 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
RUN mkdir -p /out/dev /out/proc /out/sys
FROM linuxkit/alpine:dae8bcbc6e2cec0a1cc1958dddbc5d6bd3ccf9a0@sha256:02c251d54c4083a596ead8cae92144306b385db0ff961c95a3a620a4c69961ed AS build
RUN apk add \
argp-standalone \
automake \
@ -28,15 +35,10 @@ RUN cd $pkgname-$pkgver && \
make && \
make DESTDIR=/ install && \
strip /usr/sbin/rngd
RUN mkdir -p /tmp/dev /tmp/proc /tmp/sys
FROM linuxkit/tini:cb32c9b3ceb16505e1d62919cf28c8b52bf6d57e@sha256:1645296b3e155f8cf672f71f8d20b274bf38ee94c39dd1b58f7b18e0163b00b8
FROM scratch
ENTRYPOINT []
WORKDIR /
COPY --from=mirror /out/ /
COPY --from=build usr/sbin/rngd usr/sbin/rngd
# Can't create directories, so copy empty dirs from previous context
COPY --from=build tmp/dev dev
COPY --from=build tmp/proc proc
COPY --from=build tmp/sys sys
CMD ["/bin/tini", "/usr/sbin/rngd", "-f"]
CMD ["/sbin/tini", "/usr/sbin/rngd", "-f"]

View File

@ -8,7 +8,7 @@ DEPS=Dockerfile
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --no-cache -t $(ORG)/$(IMAGE):$(HASH) .
docker build --squash --no-cache -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \