-
Notifications
You must be signed in to change notification settings - Fork 556
/
Dockerfile
165 lines (154 loc) · 6.34 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM alpine:3.19
RUN apk add --no-cache \
ca-certificates \
# DOCKER_HOST=ssh://... -- https://github.com/docker/cli/pull/1014
openssh-client
# ensure that nsswitch.conf is set up for Go's "netgo" implementation (which Docker explicitly uses)
# - https://github.com/moby/moby/blob/v24.0.6/hack/make.sh#L111
# - https://github.com/golang/go/blob/go1.19.13/src/net/conf.go#L227-L303
# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
RUN [ -e /etc/nsswitch.conf ] && grep '^hosts: files dns' /etc/nsswitch.conf
# pre-add a "docker" group for socket usage
RUN set -eux; \
addgroup -g 2375 -S docker
ENV DOCKER_VERSION 25.0.0-rc.1
RUN set -eux; \
\
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
'x86_64') \
url='https://download.docker.com/linux/static/test/x86_64/docker-25.0.0-rc.1.tgz'; \
;; \
'armhf') \
url='https://download.docker.com/linux/static/test/armel/docker-25.0.0-rc.1.tgz'; \
;; \
'armv7') \
url='https://download.docker.com/linux/static/test/armhf/docker-25.0.0-rc.1.tgz'; \
;; \
'aarch64') \
url='https://download.docker.com/linux/static/test/aarch64/docker-25.0.0-rc.1.tgz'; \
;; \
*) echo >&2 "error: unsupported 'docker.tgz' architecture ($apkArch)"; exit 1 ;; \
esac; \
\
wget -O 'docker.tgz' "$url"; \
\
tar --extract \
--file docker.tgz \
--strip-components 1 \
--directory /usr/local/bin/ \
--no-same-owner \
'docker/docker' \
; \
rm docker.tgz; \
\
docker --version
ENV DOCKER_BUILDX_VERSION 0.12.0
RUN set -eux; \
\
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
'x86_64') \
url='https://github.com/docker/buildx/releases/download/v0.12.0/buildx-v0.12.0.linux-amd64'; \
sha256='7c393b92c148a0ce26c76a2abc99960be1d1097f0471978d41dc51d0c1a4471e'; \
;; \
'armhf') \
url='https://github.com/docker/buildx/releases/download/v0.12.0/buildx-v0.12.0.linux-arm-v6'; \
sha256='62d9162f526c3bb7f67768a5b0d81a8b3ad0371406dfc1f0775e4f62dfca7fe1'; \
;; \
'armv7') \
url='https://github.com/docker/buildx/releases/download/v0.12.0/buildx-v0.12.0.linux-arm-v7'; \
sha256='d941d6a5b072de775222d31d9f8467b4c1b1f56e3b08d1b78f828a9244c16464'; \
;; \
'aarch64') \
url='https://github.com/docker/buildx/releases/download/v0.12.0/buildx-v0.12.0.linux-arm64'; \
sha256='781caebb36551b035cb9dcfaf91088543d09c73c4a2549341e6417d86b8bbb50'; \
;; \
'ppc64le') \
url='https://github.com/docker/buildx/releases/download/v0.12.0/buildx-v0.12.0.linux-ppc64le'; \
sha256='ab5bda4532528d6b0801c877999fce9def10c6a37624673fd13c668fdcde16b7'; \
;; \
'riscv64') \
url='https://github.com/docker/buildx/releases/download/v0.12.0/buildx-v0.12.0.linux-riscv64'; \
sha256='a2b846919c44128c6db9165ad24545e7e10035b6f0ad01559fcfbb2a13017127'; \
;; \
's390x') \
url='https://github.com/docker/buildx/releases/download/v0.12.0/buildx-v0.12.0.linux-s390x'; \
sha256='81c2ada65624e2ac6bb4123f3a3bb933d04cfb08aa45fc55dd201ba523d96d30'; \
;; \
*) echo >&2 "warning: unsupported 'docker-buildx' architecture ($apkArch); skipping"; exit 0 ;; \
esac; \
\
wget -O 'docker-buildx' "$url"; \
echo "$sha256 *"'docker-buildx' | sha256sum -c -; \
\
plugin='/usr/local/libexec/docker/cli-plugins/docker-buildx'; \
mkdir -p "$(dirname "$plugin")"; \
mv -vT 'docker-buildx' "$plugin"; \
chmod +x "$plugin"; \
\
docker buildx version
ENV DOCKER_COMPOSE_VERSION 2.24.0
RUN set -eux; \
\
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
'x86_64') \
url='https://github.com/docker/compose/releases/download/v2.24.0/docker-compose-linux-x86_64'; \
sha256='43fb39c0bc24ac796123935032eddcfb57a7acd9216badeb10714c986ea1e090'; \
;; \
'armhf') \
url='https://github.com/docker/compose/releases/download/v2.24.0/docker-compose-linux-armv6'; \
sha256='cb407cfd396892cc0317ef48570492d7e59445a9f50e92181fdf637548801d55'; \
;; \
'armv7') \
url='https://github.com/docker/compose/releases/download/v2.24.0/docker-compose-linux-armv7'; \
sha256='936b474e24a51a51fd797bd18290da6abf72d62a614d8730a1fed3deae816ed5'; \
;; \
'aarch64') \
url='https://github.com/docker/compose/releases/download/v2.24.0/docker-compose-linux-aarch64'; \
sha256='d23d03be5880a2f6555932c572ddbc87bd0e1c4c1985933b7488d948eb2494ca'; \
;; \
'ppc64le') \
url='https://github.com/docker/compose/releases/download/v2.24.0/docker-compose-linux-ppc64le'; \
sha256='f52678e23b143b26c2ee20af4ac105ed571bb2e8e39d59478e04bd2d81cbe27c'; \
;; \
'riscv64') \
url='https://github.com/docker/compose/releases/download/v2.24.0/docker-compose-linux-riscv64'; \
sha256='555a373414675ae21cafff8280346c94561457f4be254b5576b22f4b5e8f2ab2'; \
;; \
's390x') \
url='https://github.com/docker/compose/releases/download/v2.24.0/docker-compose-linux-s390x'; \
sha256='37871d879aa0a73f2ac59dab9805bee751d25208bbe72d7d2ab45956f2e1750a'; \
;; \
*) echo >&2 "warning: unsupported 'docker-compose' architecture ($apkArch); skipping"; exit 0 ;; \
esac; \
\
wget -O 'docker-compose' "$url"; \
echo "$sha256 *"'docker-compose' | sha256sum -c -; \
\
plugin='/usr/local/libexec/docker/cli-plugins/docker-compose'; \
mkdir -p "$(dirname "$plugin")"; \
mv -vT 'docker-compose' "$plugin"; \
chmod +x "$plugin"; \
\
ln -sv "$plugin" /usr/local/bin/; \
docker-compose --version; \
docker compose version
COPY modprobe.sh /usr/local/bin/modprobe
COPY docker-entrypoint.sh /usr/local/bin/
# https://github.com/docker-library/docker/pull/166
# dockerd-entrypoint.sh uses DOCKER_TLS_CERTDIR for auto-generating TLS certificates
# docker-entrypoint.sh uses DOCKER_TLS_CERTDIR for auto-setting DOCKER_TLS_VERIFY and DOCKER_CERT_PATH
# (For this to work, at least the "client" subdirectory of this path needs to be shared between the client and server containers via a volume, "docker cp", or other means of data sharing.)
ENV DOCKER_TLS_CERTDIR=/certs
# also, ensure the directory pre-exists and has wide enough permissions for "dockerd-entrypoint.sh" to create subdirectories, even when run in "rootless" mode
RUN mkdir /certs /certs/client && chmod 1777 /certs /certs/client
# (doing both /certs and /certs/client so that if Docker does a "copy-up" into a volume defined on /certs/client, it will "do the right thing" by default in a way that still works for rootless users)
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["sh"]