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

Commit c393955

Browse files
committed
Dockerfile: use spaces for indentation
Indenting with tabs can cause the formatting to go wonky, because the first line of any command is "indented" with spaces, but following lines are not, therefore they can be mis-aligned with the first line. Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit a42b4144bce728590d7c01aa2401589e71850518) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 0499db23d1550dde58c92ae7b99a677cc8c6657d Component: engine
1 parent bf61271 commit c393955

1 file changed

Lines changed: 95 additions & 94 deletions

File tree

components/engine/Dockerfile

Lines changed: 95 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,23 @@ FROM base AS criu
3939
ARG DEBIAN_FRONTEND
4040
# Install dependency packages specific to criu
4141
RUN apt-get update && apt-get install -y --no-install-recommends \
42-
libnet-dev \
43-
libprotobuf-c-dev \
44-
libprotobuf-dev \
45-
libnl-3-dev \
46-
libcap-dev \
47-
protobuf-compiler \
48-
protobuf-c-compiler \
49-
python-protobuf \
50-
&& rm -rf /var/lib/apt/lists/*
42+
libnet-dev \
43+
libprotobuf-c-dev \
44+
libprotobuf-dev \
45+
libnl-3-dev \
46+
libcap-dev \
47+
protobuf-compiler \
48+
protobuf-c-compiler \
49+
python-protobuf \
50+
&& rm -rf /var/lib/apt/lists/*
5151

5252
# Install CRIU for checkpoint/restore support
5353
ENV CRIU_VERSION 3.12
5454
RUN mkdir -p /usr/src/criu \
55-
&& curl -sSL https://github.com/checkpoint-restore/criu/archive/v${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \
56-
&& cd /usr/src/criu \
57-
&& make \
58-
&& make PREFIX=/build/ install-criu
55+
&& curl -sSL https://github.com/checkpoint-restore/criu/archive/v${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \
56+
&& cd /usr/src/criu \
57+
&& make \
58+
&& make PREFIX=/build/ install-criu
5959

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

8282
FROM base AS swagger
8383
# Install go-swagger for validating swagger.yaml
8484
# This is https://github.com/kolyshkin/go-swagger/tree/golang-1.13-fix
8585
# TODO: move to under moby/ or fix upstream go-swagger to work for us.
8686
ENV GO_SWAGGER_COMMIT 5793aa66d4b4112c2602c716516e24710e4adbb5
8787
RUN set -x \
88-
&& export GOPATH="$(mktemp -d)" \
89-
&& git clone https://github.com/kolyshkin/go-swagger.git "$GOPATH/src/github.com/go-swagger/go-swagger" \
90-
&& (cd "$GOPATH/src/github.com/go-swagger/go-swagger" && git checkout -q "$GO_SWAGGER_COMMIT") \
91-
&& go build -o /build/swagger github.com/go-swagger/go-swagger/cmd/swagger \
92-
&& rm -rf "$GOPATH"
88+
&& export GOPATH="$(mktemp -d)" \
89+
&& git clone https://github.com/kolyshkin/go-swagger.git "$GOPATH/src/github.com/go-swagger/go-swagger" \
90+
&& (cd "$GOPATH/src/github.com/go-swagger/go-swagger" && git checkout -q "$GO_SWAGGER_COMMIT") \
91+
&& go build -o /build/swagger github.com/go-swagger/go-swagger/cmd/swagger \
92+
&& rm -rf "$GOPATH"
9393

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

110110
FROM base AS cross-false
@@ -115,41 +115,42 @@ RUN dpkg --add-architecture armhf
115115
RUN dpkg --add-architecture arm64
116116
RUN dpkg --add-architecture armel
117117
RUN if [ "$(go env GOHOSTARCH)" = "amd64" ]; then \
118-
apt-get update && apt-get install -y --no-install-recommends \
119-
crossbuild-essential-armhf \
120-
crossbuild-essential-arm64 \
121-
crossbuild-essential-armel \
122-
&& rm -rf /var/lib/apt/lists/*; \
123-
fi
118+
apt-get update && apt-get install -y --no-install-recommends \
119+
crossbuild-essential-armhf \
120+
crossbuild-essential-arm64 \
121+
crossbuild-essential-armel \
122+
&& rm -rf /var/lib/apt/lists/*; \
123+
fi
124124

125125
FROM cross-${CROSS} as dev-base
126126

127127
FROM dev-base AS runtime-dev-cross-false
128128
ARG DEBIAN_FRONTEND
129129
RUN apt-get update && apt-get install -y --no-install-recommends \
130-
libapparmor-dev \
131-
libseccomp-dev \
132-
&& rm -rf /var/lib/apt/lists/*
130+
libapparmor-dev \
131+
libseccomp-dev \
132+
&& rm -rf /var/lib/apt/lists/*
133+
133134
FROM cross-true AS runtime-dev-cross-true
134135
ARG DEBIAN_FRONTEND
135136
# These crossbuild packages rely on gcc-<arch>, but this doesn't want to install
136137
# on non-amd64 systems.
137138
# Additionally, the crossbuild-amd64 is currently only on debian:buster, so
138139
# other architectures cannnot crossbuild amd64.
139140
RUN if [ "$(go env GOHOSTARCH)" = "amd64" ]; then \
140-
apt-get update && apt-get install -y --no-install-recommends \
141-
libseccomp-dev:armhf \
142-
libseccomp-dev:arm64 \
143-
libseccomp-dev:armel \
144-
libapparmor-dev:armhf \
145-
libapparmor-dev:arm64 \
146-
libapparmor-dev:armel \
147-
# install this arches seccomp here due to compat issues with the v0 builder
148-
# This is as opposed to inheriting from runtime-dev-cross-false
149-
libapparmor-dev \
150-
libseccomp-dev \
151-
&& rm -rf /var/lib/apt/lists/*; \
152-
fi
141+
apt-get update && apt-get install -y --no-install-recommends \
142+
libseccomp-dev:armhf \
143+
libseccomp-dev:arm64 \
144+
libseccomp-dev:armel \
145+
libapparmor-dev:armhf \
146+
libapparmor-dev:arm64 \
147+
libapparmor-dev:armel \
148+
# install this arches seccomp here due to compat issues with the v0 builder
149+
# This is as opposed to inheriting from runtime-dev-cross-false
150+
libapparmor-dev \
151+
libseccomp-dev \
152+
&& rm -rf /var/lib/apt/lists/*; \
153+
fi
153154

154155
FROM runtime-dev-cross-${CROSS} AS runtime-dev
155156

@@ -171,8 +172,8 @@ FROM dev-base AS containerd
171172
ARG DEBIAN_FRONTEND
172173
ARG CONTAINERD_COMMIT
173174
RUN apt-get update && apt-get install -y --no-install-recommends \
174-
btrfs-tools \
175-
&& rm -rf /var/lib/apt/lists/*
175+
btrfs-tools \
176+
&& rm -rf /var/lib/apt/lists/*
176177
ENV INSTALL_BINARY_NAME=containerd
177178
COPY hack/dockerfile/install/install.sh ./install.sh
178179
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
@@ -218,9 +219,9 @@ FROM dev-base AS tini
218219
ARG DEBIAN_FRONTEND
219220
ARG TINI_COMMIT
220221
RUN apt-get update && apt-get install -y --no-install-recommends \
221-
cmake \
222-
vim-common \
223-
&& rm -rf /var/lib/apt/lists/*
222+
cmake \
223+
vim-common \
224+
&& rm -rf /var/lib/apt/lists/*
224225
COPY hack/dockerfile/install/install.sh ./install.sh
225226
ENV INSTALL_BINARY_NAME=tini
226227
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
@@ -248,34 +249,34 @@ RUN ldconfig
248249
# This should only install packages that are specifically needed for the dev environment and nothing else
249250
# Do you really need to add another package here? Can it be done in a different build stage?
250251
RUN apt-get update && apt-get install -y --no-install-recommends \
251-
apparmor \
252-
aufs-tools \
253-
bash-completion \
254-
btrfs-tools \
255-
iptables \
256-
jq \
257-
libcap2-bin \
258-
libdevmapper-dev \
259-
libudev-dev \
260-
libsystemd-dev \
261-
binutils-mingw-w64 \
262-
g++-mingw-w64-x86-64 \
263-
net-tools \
264-
pigz \
265-
python3-pip \
266-
python3-setuptools \
267-
python3-wheel \
268-
thin-provisioning-tools \
269-
vim \
270-
vim-common \
271-
xfsprogs \
272-
zip \
273-
bzip2 \
274-
xz-utils \
275-
libprotobuf-c1 \
276-
libnet1 \
277-
libnl-3-200 \
278-
&& rm -rf /var/lib/apt/lists/*
252+
apparmor \
253+
aufs-tools \
254+
bash-completion \
255+
btrfs-tools \
256+
iptables \
257+
jq \
258+
libcap2-bin \
259+
libdevmapper-dev \
260+
libudev-dev \
261+
libsystemd-dev \
262+
binutils-mingw-w64 \
263+
g++-mingw-w64-x86-64 \
264+
net-tools \
265+
pigz \
266+
python3-pip \
267+
python3-setuptools \
268+
python3-wheel \
269+
thin-provisioning-tools \
270+
vim \
271+
vim-common \
272+
xfsprogs \
273+
zip \
274+
bzip2 \
275+
xz-utils \
276+
libprotobuf-c1 \
277+
libnet1 \
278+
libnl-3-200 \
279+
&& rm -rf /var/lib/apt/lists/*
279280

280281
RUN pip3 install yamllint==1.16.0
281282

0 commit comments

Comments
 (0)