Repository navigation
Expand file tree
/
Copy pathDockerfile.tools
More file actions
219 lines (202 loc) · 9.59 KB
/
Copy pathDockerfile.tools
File metadata and controls
219 lines (202 loc) · 9.59 KB
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
FROM ubuntu:noble-20251013
ENV DEBIAN_FRONTEND=noninteractive
ENV ACCEPT_EULA=y
ARG AWS_CLI_VERSION=2.28.6
ARG GCLOUD_VERSION=533.0.0-0
ARG GCLOUD_GKE_AUTHN_PLUGIN_VERSION=467.0.0-0
ARG NODE_VERSION=22.18.0
# The legacy MongoDB 5.0 shell (/usr/local/bin/mongo) is SSPL-licensed. It is
# kept on the default "legacy" image train for backward compatibility, and
# excluded from the "clean" train (INCLUDE_LEGACY_MONGO=false), which ships only
# mongosh (Apache-2.0). This default will flip to false once the legacy train is
# retired. Declared and license-gated in licenses/manual-binaries.toml.
ARG INCLUDE_LEGACY_MONGO=true
# Common
RUN mkdir -p /app && \
apt update -y && \
apt install -y \
python3-dev \
python3-pip \
python3.12 \
locales \
tini \
apt-utils \
curl \
gnupg \
gnupg2 \
net-tools \
netcat-openbsd \
jq \
openssh-client \
unzip \
expect \
less \
gettext-base \
lsb-release \
alien \
libaio1t64 \
elfutils \
libelf-dev \
bc \
bzip2 \
wget \
redis-tools && \
# groff is only needed by `aws help` to render man pages to the terminal.
# Install it without Recommends: they pull ghostscript (AGPL), imagemagick,
# netpbm and psutils (GPL), which groff only uses for PostScript/PDF output
# that nothing in this image produces.
apt install -y --no-install-recommends groff && \
ln -s /usr/bin/python3 /usr/bin/python
# https://github.com/nodejs/release-keys
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) ARCH='x64';; \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
i386) ARCH='x86';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& export GNUPGHOME="$(mktemp -d)" \
&& set -ex \
&& for key in \
5BE8A3F6C8A5C01D106C0AD820B1A390B168D356 \
4ED778F539E3634C779C87C6D7062848A1AB005C \
141F07595B7B3FFE74309A937405533BE57C7D57 \
74F12602B6F1C4E913FAA37AD3A89613643B6201 \
DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 \
61FC681DFB92A079F1685E77973F295594EC4689 \
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
108F52B48DB57BB0CC439B2997B01419BD92F80A \
A363A499291CBBC940DD62E41F10027AF002F8B0 \
CC68F5A3106FF448322E48ED27F5E38D5B0A215F \
; do \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
done \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
&& gpgconf --kill all \
&& rm -rf "$GNUPGHOME" \
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
&& node --version \
&& npm --version
RUN curl -sL "https://dl.k8s.io/release/v1.29.15/bin/linux/$(dpkg --print-architecture)/kubectl" -o kubectl && \
chmod 755 kubectl && \
mv kubectl /usr/local/bin/kubectl
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) ARCH='x86_64';; \
arm64) ARCH='aarch64';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -sL "https://awscli.amazonaws.com/awscli-exe-linux-$ARCH.zip" -o awscli-exe-linux.zip && \
unzip -q awscli-exe-linux.zip && \
aws/install && \
aws --version && \
rm -rf awscli-exe-linux.zip aws
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) ARCH='ubuntu_64bit';; \
arm64) ARCH='ubuntu_arm64';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -sL "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/$ARCH/session-manager-plugin.deb" -o session-manager-plugin.deb && \
dpkg -i session-manager-plugin.deb && \
rm -f session-manager-plugin.deb
RUN LIBSSL_1_1_REPO= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) LIBSSL_1_1_REPO='deb http://security.ubuntu.com/ubuntu focal-security main';; \
arm64) LIBSSL_1_1_REPO='deb http://ports.ubuntu.com/ubuntu-ports focal-security main';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& echo $LIBSSL_1_1_REPO | tee /etc/apt/sources.list.d/focal-security.list && \
wget -qO- https://www.mongodb.org/static/pgp/server-8.0.asc | tee /etc/apt/trusted.gpg.d/server-8.0.asc && \
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-8.0.list && \
curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl -sL https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
# legacy mongo client (MongoDB 5.0 shell, SSPL). Included only on the legacy
# train; the clean train ships mongosh (Apache-2.0) instead. libssl1.1 is a
# dependency of this shell alone, so it is installed inside the same guard.
RUN if [ "$INCLUDE_LEGACY_MONGO" = "true" ]; then \
ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) ARCH='x86_64';; \
arm64) ARCH='aarch64';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -fsSLO --compressed https://fastdl.mongodb.org/linux/mongodb-linux-$ARCH-ubuntu2004-5.0.31.tgz \
&& apt update -y && apt install libssl1.1 -y \
&& tar -xzf mongodb-linux-$ARCH-ubuntu2004-5.0.31.tgz \
&& mv mongodb-linux-$ARCH-ubuntu2004-5.0.31/bin/mongo /usr/local/bin/mongo \
&& rm -rf mongodb-linux-$ARCH-ubuntu2004-5.0.31.tgz mongodb-linux-$ARCH-ubuntu2004-5.0.31 \
&& mongo --version ; \
else \
echo "INCLUDE_LEGACY_MONGO=false: skipping legacy SSPL mongo 5.0 shell (clean train)"; \
fi
RUN apt update -y && apt install -y \
mongodb-mongosh=2.5.6 \
mongodb-org-tools=8.0.12 \
default-mysql-client=1.1.0build1 \
unixodbc-dev=2.3.12-1ubuntu0.24.04.1 \
postgresql-client-16=16.14-0ubuntu0.24.04.1 \
google-cloud-cli=$GCLOUD_VERSION \
google-cloud-sdk-gke-gcloud-auth-plugin=$GCLOUD_GKE_AUTHN_PLUGIN_VERSION && \
curl -fsSLO --compressed https://github.com/microsoft/go-sqlcmd/releases/download/v1.8.2/sqlcmd-linux-$(dpkg --print-architecture).tar.bz2 && \
tar -xf sqlcmd-linux-$(dpkg --print-architecture).tar.bz2 -C /usr/local/bin/ sqlcmd && \
rm -f sqlcmd-linux-$(dpkg --print-architecture).tar.bz2 && \
sqlcmd --version && \
rm -rf /var/lib/apt/lists/*
# configure libaio symlink for oracle client
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1;; \
arm64) ln -s /usr/lib/aarch64-linux-gnu/libaio.so.1t64 /usr/lib/aarch64-linux-gnu/libaio.so.1;; \
*) echo "unsupported architecture"; exit 1 ;; \
esac
# Download and install Oracle Instant Client and SQL*Plus
RUN URL_ORACLE_BASIC= && URL_ORACLE_SQLPLUS= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) URL_ORACLE_BASIC='https://download.oracle.com/otn_software/linux/instantclient/2390000/instantclient-basic-linux.x64-23.9.0.25.07.zip';; \
arm64) URL_ORACLE_BASIC='https://download.oracle.com/otn_software/linux/instantclient/instantclient-basic-linux-arm64.zip';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& case "${dpkgArch##*-}" in \
amd64) URL_ORACLE_SQLPLUS='https://download.oracle.com/otn_software/linux/instantclient/2390000/instantclient-sqlplus-linux.x64-23.9.0.25.07.zip';; \
arm64) URL_ORACLE_SQLPLUS='https://download.oracle.com/otn_software/linux/instantclient/instantclient-sqlplus-linux-arm64.zip';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& mkdir -p /opt/oracle && \
cd /opt/oracle && \
wget -qO instantclient-basic-linux.zip $URL_ORACLE_BASIC && \
wget -qO instantclient-sqlplus-linux.zip $URL_ORACLE_SQLPLUS && \
unzip -j instantclient-basic-linux.zip 'instantclient_*/*' -d instantclient && \
unzip -j instantclient-sqlplus-linux.zip 'instantclient_*/*' -d instantclient && \
rm -rf META-INF && rm instantclient-basic-linux.zip && rm instantclient-sqlplus-linux.zip && \
echo 'set markup csv on delimiter "\t" quote off\nset heading on echo off termout off\nset feedback off trimspool on' >> /opt/oracle/instantclient/glogin.sql && \
LD_LIBRARY_PATH=/opt/oracle/instantclient /opt/oracle/instantclient/sqlplus -V && \
cd /
# Configure environment variables
ENV PATH="/opt/oracle/instantclient:$PATH"
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient"
RUN pip3 install -U \
boto3==1.40.6 \
requests==2.32.4 \
--break-system-packages
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
ENV NODE_PATH=/usr/local/lib/node_modules/
ENV PATH="/app:${PATH}"
ENTRYPOINT ["tini", "--"]