mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 01:59:07 +00:00
pkg: Convert docker-ce to use the Alpine base and git tree hash
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
e929205c31
commit
43d97967ef
@ -1,15 +1,9 @@
|
|||||||
FROM alpine:3.5
|
FROM linuxkit/alpine:f0169b60fb260d74025496ae6fd93213fecaba8f@sha256:23743c7206ebe8a609442c5ac7084a26ed45ce8f5213960428bca264225849f1 AS mirror
|
||||||
|
|
||||||
# Docker daemon only minimal Alpine install
|
FROM alpine:3.5@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8
|
||||||
|
COPY --from=mirror /etc/apk/repositories /etc/apk/repositories
|
||||||
# set up Docker group
|
COPY --from=mirror /etc/apk/keys /etc/apk/keys/
|
||||||
# set up subuid/subgid so that "--userns-remap=default" works out-of-the-box
|
COPY --from=mirror /mirror /mirror/
|
||||||
RUN set -x \
|
|
||||||
&& addgroup -S docker \
|
|
||||||
&& addgroup -S dockremap \
|
|
||||||
&& adduser -S -G dockremap dockremap \
|
|
||||||
&& echo 'dockremap:165536:65536' >> /etc/subuid \
|
|
||||||
&& echo 'dockremap:165536:65536' >> /etc/subgid
|
|
||||||
|
|
||||||
# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies
|
# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies
|
||||||
# removed openssl as I do not think server needs it
|
# removed openssl as I do not think server needs it
|
||||||
@ -22,6 +16,16 @@ RUN apk add --no-cache \
|
|||||||
iptables \
|
iptables \
|
||||||
xfsprogs \
|
xfsprogs \
|
||||||
xz
|
xz
|
||||||
|
RUN rm -rf /mirror /etc/apk/repositories /etc/apk/keys
|
||||||
|
|
||||||
|
# set up Docker group
|
||||||
|
# set up subuid/subgid so that "--userns-remap=default" works out-of-the-box
|
||||||
|
RUN set -x \
|
||||||
|
&& addgroup -S docker \
|
||||||
|
&& addgroup -S dockremap \
|
||||||
|
&& adduser -S -G dockremap dockremap \
|
||||||
|
&& echo 'dockremap:165536:65536' >> /etc/subuid \
|
||||||
|
&& echo 'dockremap:165536:65536' >> /etc/subgid
|
||||||
|
|
||||||
ENV DOCKER_BUCKET get.docker.com
|
ENV DOCKER_BUCKET get.docker.com
|
||||||
ENV DOCKER_VERSION 17.04.0-ce
|
ENV DOCKER_VERSION 17.04.0-ce
|
||||||
|
@ -1,29 +1,14 @@
|
|||||||
.PHONY: tag push
|
.PHONY: tag push
|
||||||
|
|
||||||
BASE=alpine:3.5
|
|
||||||
IMAGE=docker-ce
|
|
||||||
|
|
||||||
default: push
|
default: push
|
||||||
|
|
||||||
hash: Dockerfile
|
IMAGE=docker-ce
|
||||||
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
DEPS=Dockerfile
|
||||||
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
|
||||||
docker run --entrypoint /bin/sh --rm $(IMAGE):build -c 'cat $^ /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > $@
|
|
||||||
|
|
||||||
push: hash
|
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
|
||||||
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
|
tag: $(DEPS)
|
||||||
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
docker build --squash --no-cache -t linuxkit/$(IMAGE):$(HASH) .
|
||||||
docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash)
|
|
||||||
docker rmi $(IMAGE):build
|
|
||||||
rm -f hash
|
|
||||||
|
|
||||||
clean:
|
push: tag
|
||||||
rm -f hash
|
docker pull linuxkit/$(IMAGE):$(HASH) || \
|
||||||
|
docker push linuxkit/$(IMAGE):$(HASH)
|
||||||
.DELETE_ON_ERROR:
|
|
||||||
|
Loading…
Reference in New Issue
Block a user