Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 4b2f1aa

Browse files
Merge component 'engine' from git@github.com:docker/engine 19.03
2 parents 14702d0 + 10c2fab commit 4b2f1aa

117 files changed

Lines changed: 84432 additions & 5492 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

components/engine/Dockerfile

Lines changed: 138 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,37 @@
2626

2727
ARG CROSS="false"
2828
# IMPORTANT: When updating this please note that stdlib archive/tar pkg is vendored
29-
ARG GO_VERSION=1.12.17
29+
ARG GO_VERSION=1.13.10
3030
ARG DEBIAN_FRONTEND=noninteractive
31+
ARG VPNKIT_DIGEST=e508a17cfacc8fd39261d5b4e397df2b953690da577e2c987a47630cd0c42f8e
3132

32-
FROM golang:${GO_VERSION}-stretch AS base
33+
FROM golang:${GO_VERSION}-buster AS base
3334
ARG APT_MIRROR
3435
RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/apt/sources.list \
3536
&& sed -ri "s/(security).debian.org/${APT_MIRROR:-security.debian.org}/g" /etc/apt/sources.list
37+
ENV GO111MODULE=off
3638

3739
FROM base AS criu
3840
ARG DEBIAN_FRONTEND
39-
# Install CRIU for checkpoint/restore support
40-
ENV CRIU_VERSION 3.12
4141
# Install dependency packages specific to criu
4242
RUN apt-get update && apt-get install -y --no-install-recommends \
43-
libnet-dev \
44-
libprotobuf-c-dev \
45-
libprotobuf-dev \
46-
libnl-3-dev \
47-
libcap-dev \
48-
protobuf-compiler \
49-
protobuf-c-compiler \
50-
python-protobuf \
51-
&& rm -rf /var/lib/apt/lists/*
43+
libcap-dev \
44+
libnet-dev \
45+
libnl-3-dev \
46+
libprotobuf-c-dev \
47+
libprotobuf-dev \
48+
protobuf-c-compiler \
49+
protobuf-compiler \
50+
python-protobuf \
51+
&& rm -rf /var/lib/apt/lists/*
52+
53+
# Install CRIU for checkpoint/restore support
54+
ENV CRIU_VERSION 3.13
5255
RUN mkdir -p /usr/src/criu \
53-
&& curl -sSL https://github.com/checkpoint-restore/criu/archive/v${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \
54-
&& cd /usr/src/criu \
55-
&& make \
56-
&& make PREFIX=/build/ install-criu
56+
&& curl -sSL https://github.com/checkpoint-restore/criu/archive/v${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \
57+
&& cd /usr/src/criu \
58+
&& make \
59+
&& make PREFIX=/build/ install-criu
5760

5861
FROM base AS registry
5962
# Install two versions of the registry. The first is an older version that
@@ -63,116 +66,123 @@ FROM base AS registry
6366
ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
6467
ENV REGISTRY_COMMIT 47a064d4195a9b56133891bbb13620c3ac83a827
6568
RUN set -x \
66-
&& export GOPATH="$(mktemp -d)" \
67-
&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
68-
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
69-
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
70-
go build -buildmode=pie -o /build/registry-v2 github.com/docker/distribution/cmd/registry \
71-
&& case $(dpkg --print-architecture) in \
72-
amd64|ppc64*|s390x) \
73-
(cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1"); \
74-
GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH"; \
75-
go build -buildmode=pie -o /build/registry-v2-schema1 github.com/docker/distribution/cmd/registry; \
76-
;; \
77-
esac \
78-
&& rm -rf "$GOPATH"
69+
&& export GOPATH="$(mktemp -d)" \
70+
&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
71+
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
72+
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
73+
go build -buildmode=pie -o /build/registry-v2 github.com/docker/distribution/cmd/registry \
74+
&& case $(dpkg --print-architecture) in \
75+
amd64|ppc64*|s390x) \
76+
(cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1"); \
77+
GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH"; \
78+
go build -buildmode=pie -o /build/registry-v2-schema1 github.com/docker/distribution/cmd/registry; \
79+
;; \
80+
esac \
81+
&& rm -rf "$GOPATH"
7982

8083
FROM base AS swagger
8184
# Install go-swagger for validating swagger.yaml
82-
ENV GO_SWAGGER_COMMIT c28258affb0b6251755d92489ef685af8d4ff3eb
85+
# This is https://github.com/kolyshkin/go-swagger/tree/golang-1.13-fix
86+
# TODO: move to under moby/ or fix upstream go-swagger to work for us.
87+
ENV GO_SWAGGER_COMMIT 5793aa66d4b4112c2602c716516e24710e4adbb5
8388
RUN set -x \
84-
&& export GOPATH="$(mktemp -d)" \
85-
&& git clone https://github.com/go-swagger/go-swagger.git "$GOPATH/src/github.com/go-swagger/go-swagger" \
86-
&& (cd "$GOPATH/src/github.com/go-swagger/go-swagger" && git checkout -q "$GO_SWAGGER_COMMIT") \
87-
&& go build -o /build/swagger github.com/go-swagger/go-swagger/cmd/swagger \
88-
&& rm -rf "$GOPATH"
89+
&& export GOPATH="$(mktemp -d)" \
90+
&& git clone https://github.com/kolyshkin/go-swagger.git "$GOPATH/src/github.com/go-swagger/go-swagger" \
91+
&& (cd "$GOPATH/src/github.com/go-swagger/go-swagger" && git checkout -q "$GO_SWAGGER_COMMIT") \
92+
&& go build -o /build/swagger github.com/go-swagger/go-swagger/cmd/swagger \
93+
&& rm -rf "$GOPATH"
8994

9095
FROM base AS frozen-images
9196
ARG DEBIAN_FRONTEND
9297
RUN apt-get update && apt-get install -y --no-install-recommends \
93-
ca-certificates \
94-
jq \
95-
&& rm -rf /var/lib/apt/lists/*
98+
ca-certificates \
99+
jq \
100+
&& rm -rf /var/lib/apt/lists/*
96101
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
97102
COPY contrib/download-frozen-image-v2.sh /
98103
RUN /download-frozen-image-v2.sh /build \
99-
buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
100-
busybox:latest@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0 \
101-
busybox:glibc@sha256:0b55a30394294ab23b9afd58fab94e61a923f5834fba7ddbae7f8e0c11ba85e6 \
102-
debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
103-
hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
104+
buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
105+
busybox:latest@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0 \
106+
busybox:glibc@sha256:0b55a30394294ab23b9afd58fab94e61a923f5834fba7ddbae7f8e0c11ba85e6 \
107+
debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
108+
hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
104109
# See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)
105110

106111
FROM base AS cross-false
107112

108113
FROM base AS cross-true
109114
ARG DEBIAN_FRONTEND
110-
RUN dpkg --add-architecture armhf
111115
RUN dpkg --add-architecture arm64
112116
RUN dpkg --add-architecture armel
117+
RUN dpkg --add-architecture armhf
113118
RUN if [ "$(go env GOHOSTARCH)" = "amd64" ]; then \
114-
apt-get update && apt-get install -y --no-install-recommends \
115-
crossbuild-essential-armhf \
116-
crossbuild-essential-arm64 \
117-
crossbuild-essential-armel \
118-
&& rm -rf /var/lib/apt/lists/*; \
119-
fi
119+
apt-get update && apt-get install -y --no-install-recommends \
120+
crossbuild-essential-arm64 \
121+
crossbuild-essential-armel \
122+
crossbuild-essential-armhf \
123+
&& rm -rf /var/lib/apt/lists/*; \
124+
fi
120125

121126
FROM cross-${CROSS} as dev-base
122127

123128
FROM dev-base AS runtime-dev-cross-false
124129
ARG DEBIAN_FRONTEND
125130
RUN apt-get update && apt-get install -y --no-install-recommends \
126-
libapparmor-dev \
127-
libseccomp-dev \
128-
&& rm -rf /var/lib/apt/lists/*
131+
libapparmor-dev \
132+
libseccomp-dev \
133+
&& rm -rf /var/lib/apt/lists/*
134+
129135
FROM cross-true AS runtime-dev-cross-true
130136
ARG DEBIAN_FRONTEND
131137
# These crossbuild packages rely on gcc-<arch>, but this doesn't want to install
132138
# on non-amd64 systems.
133139
# Additionally, the crossbuild-amd64 is currently only on debian:buster, so
134140
# other architectures cannnot crossbuild amd64.
135141
RUN if [ "$(go env GOHOSTARCH)" = "amd64" ]; then \
136-
apt-get update && apt-get install -y --no-install-recommends \
137-
libseccomp-dev:armhf \
138-
libseccomp-dev:arm64 \
139-
libseccomp-dev:armel \
140-
libapparmor-dev:armhf \
141-
libapparmor-dev:arm64 \
142-
libapparmor-dev:armel \
143-
# install this arches seccomp here due to compat issues with the v0 builder
144-
# This is as opposed to inheriting from runtime-dev-cross-false
145-
libapparmor-dev \
146-
libseccomp-dev \
147-
&& rm -rf /var/lib/apt/lists/*; \
148-
fi
142+
apt-get update && apt-get install -y --no-install-recommends \
143+
libapparmor-dev:arm64 \
144+
libapparmor-dev:armel \
145+
libapparmor-dev:armhf \
146+
libseccomp-dev:arm64 \
147+
libseccomp-dev:armel \
148+
libseccomp-dev:armhf \
149+
# install this arches seccomp here due to compat issues with the v0 builder
150+
# This is as opposed to inheriting from runtime-dev-cross-false
151+
libapparmor-dev \
152+
libseccomp-dev \
153+
&& rm -rf /var/lib/apt/lists/*; \
154+
fi
149155

150156
FROM runtime-dev-cross-${CROSS} AS runtime-dev
151157

152158
FROM base AS tomlv
153159
ENV INSTALL_BINARY_NAME=tomlv
160+
ARG TOMLV_COMMIT
154161
COPY hack/dockerfile/install/install.sh ./install.sh
155162
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
156163
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
157164

158165
FROM base AS vndr
159166
ENV INSTALL_BINARY_NAME=vndr
167+
ARG VNDR_COMMIT
160168
COPY hack/dockerfile/install/install.sh ./install.sh
161169
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
162170
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
163171

164172
FROM dev-base AS containerd
165173
ARG DEBIAN_FRONTEND
174+
ARG CONTAINERD_COMMIT
166175
RUN apt-get update && apt-get install -y --no-install-recommends \
167-
btrfs-tools \
168-
&& rm -rf /var/lib/apt/lists/*
176+
libbtrfs-dev \
177+
&& rm -rf /var/lib/apt/lists/*
169178
ENV INSTALL_BINARY_NAME=containerd
170179
COPY hack/dockerfile/install/install.sh ./install.sh
171180
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
172181
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
173182

174183
FROM dev-base AS proxy
175184
ENV INSTALL_BINARY_NAME=proxy
185+
ARG LIBNETWORK_COMMIT
176186
COPY hack/dockerfile/install/install.sh ./install.sh
177187
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
178188
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
@@ -185,40 +195,49 @@ RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
185195

186196
FROM base AS gotestsum
187197
ENV INSTALL_BINARY_NAME=gotestsum
198+
ARG GOTESTSUM_COMMIT
188199
COPY hack/dockerfile/install/install.sh ./install.sh
189200
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
190201
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
191202

192203
FROM dev-base AS dockercli
193204
ENV INSTALL_BINARY_NAME=dockercli
205+
ARG DOCKERCLI_CHANNEL
206+
ARG DOCKERCLI_VERSION
194207
COPY hack/dockerfile/install/install.sh ./install.sh
195208
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
196209
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
197210

198211
FROM runtime-dev AS runc
199212
ENV INSTALL_BINARY_NAME=runc
213+
ARG RUNC_COMMIT
214+
ARG RUNC_BUILDTAGS
200215
COPY hack/dockerfile/install/install.sh ./install.sh
201216
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
202217
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
203218

204219
FROM dev-base AS tini
205220
ARG DEBIAN_FRONTEND
221+
ARG TINI_COMMIT
206222
RUN apt-get update && apt-get install -y --no-install-recommends \
207-
cmake \
208-
vim-common \
209-
&& rm -rf /var/lib/apt/lists/*
223+
cmake \
224+
vim-common \
225+
&& rm -rf /var/lib/apt/lists/*
210226
COPY hack/dockerfile/install/install.sh ./install.sh
211227
ENV INSTALL_BINARY_NAME=tini
212228
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
213229
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
214230

215231
FROM dev-base AS rootlesskit
216232
ENV INSTALL_BINARY_NAME=rootlesskit
233+
ARG ROOTLESSKIT_COMMIT
217234
COPY hack/dockerfile/install/install.sh ./install.sh
218235
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
219236
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
220237
COPY ./contrib/dockerd-rootless.sh /build
221238

239+
FROM djs55/vpnkit@sha256:${VPNKIT_DIGEST} AS vpnkit
240+
222241
# TODO: Some of this is only really needed for testing, it would be nice to split this up
223242
FROM runtime-dev AS dev
224243
ARG DEBIAN_FRONTEND
@@ -233,52 +252,57 @@ RUN ldconfig
233252
# This should only install packages that are specifically needed for the dev environment and nothing else
234253
# Do you really need to add another package here? Can it be done in a different build stage?
235254
RUN apt-get update && apt-get install -y --no-install-recommends \
236-
apparmor \
237-
aufs-tools \
238-
bash-completion \
239-
btrfs-tools \
240-
iptables \
241-
jq \
242-
libcap2-bin \
243-
libdevmapper-dev \
244-
libudev-dev \
245-
libsystemd-dev \
246-
binutils-mingw-w64 \
247-
g++-mingw-w64-x86-64 \
248-
net-tools \
249-
pigz \
250-
python3-pip \
251-
python3-setuptools \
252-
python3-wheel \
253-
thin-provisioning-tools \
254-
vim \
255-
vim-common \
256-
xfsprogs \
257-
zip \
258-
bzip2 \
259-
xz-utils \
260-
libprotobuf-c1 \
261-
libnet1 \
262-
libnl-3-200 \
263-
&& rm -rf /var/lib/apt/lists/*
255+
apparmor \
256+
aufs-tools \
257+
bash-completion \
258+
binutils-mingw-w64 \
259+
libbtrfs-dev \
260+
bzip2 \
261+
g++-mingw-w64-x86-64 \
262+
iptables \
263+
jq \
264+
libcap2-bin \
265+
libdevmapper-dev \
266+
libnet1 \
267+
libnl-3-200 \
268+
libprotobuf-c1 \
269+
libsystemd-dev \
270+
libudev-dev \
271+
net-tools \
272+
pigz \
273+
python3-pip \
274+
python3-setuptools \
275+
python3-wheel \
276+
thin-provisioning-tools \
277+
vim \
278+
vim-common \
279+
xfsprogs \
280+
xz-utils \
281+
zip \
282+
&& rm -rf /var/lib/apt/lists/*
283+
284+
# Switch to use iptables instead of nftables (to match the host machine)
285+
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy || true \
286+
&& update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy || true \
287+
&& update-alternatives --set arptables /usr/sbin/arptables-legacy || true
264288

265289
RUN pip3 install yamllint==1.16.0
266290

267-
COPY --from=swagger /build/swagger* /usr/local/bin/
291+
COPY --from=dockercli /build/ /usr/local/cli
268292
COPY --from=frozen-images /build/ /docker-frozen-images
269-
COPY --from=gometalinter /build/ /usr/local/bin/
270-
COPY --from=gotestsum /build/ /usr/local/bin/
271-
COPY --from=tomlv /build/ /usr/local/bin/
272-
COPY --from=vndr /build/ /usr/local/bin/
273-
COPY --from=tini /build/ /usr/local/bin/
274-
COPY --from=runc /build/ /usr/local/bin/
275-
COPY --from=containerd /build/ /usr/local/bin/
276-
COPY --from=proxy /build/ /usr/local/bin/
277-
COPY --from=dockercli /build/ /usr/local/cli
278-
COPY --from=registry /build/registry* /usr/local/bin/
279-
COPY --from=criu /build/ /usr/local/
280-
COPY --from=rootlesskit /build/ /usr/local/bin/
281-
COPY --from=djs55/vpnkit@sha256:e508a17cfacc8fd39261d5b4e397df2b953690da577e2c987a47630cd0c42f8e /vpnkit /usr/local/bin/vpnkit.x86_64
293+
COPY --from=swagger /build/ /usr/local/bin/
294+
COPY --from=tomlv /build/ /usr/local/bin/
295+
COPY --from=tini /build/ /usr/local/bin/
296+
COPY --from=registry /build/ /usr/local/bin/
297+
COPY --from=criu /build/ /usr/local/
298+
COPY --from=vndr /build/ /usr/local/bin/
299+
COPY --from=gotestsum /build/ /usr/local/bin/
300+
COPY --from=gometalinter /build/ /usr/local/bin/
301+
COPY --from=runc /build/ /usr/local/bin/
302+
COPY --from=containerd /build/ /usr/local/bin/
303+
COPY --from=rootlesskit /build/ /usr/local/bin/
304+
COPY --from=vpnkit /vpnkit /usr/local/bin/vpnkit.x86_64
305+
COPY --from=proxy /build/ /usr/local/bin/
282306

283307
ENV PATH=/usr/local/cli:$PATH
284308
ENV DOCKER_BUILDTAGS apparmor seccomp selinux

0 commit comments

Comments
 (0)