1
- FROM debian:buster AS base
1
+ FROM debian:bookworm AS base
2
2
3
3
ENV LANG=C.UTF-8
4
4
ENV DEBIAN_FRONTEND=noninteractive
@@ -9,9 +9,11 @@ ENV ACCEPT_EULA=Y
9
9
# with cross-language link-time optimization. Needs to match rustc -Vv's llvm
10
10
# version.
11
11
ENV DEVLIBS \
12
+ catch2 \
12
13
clang-16 \
14
+ cmake \
15
+ lcov \
13
16
libclang-16-dev \
14
- libclang-rt-16-dev \
15
17
llvm-16-dev \
16
18
lld-16 \
17
19
libcurl4-openssl-dev \
@@ -32,25 +34,25 @@ ENV DEVLIBS \
32
34
libxml2-dev \
33
35
libxslt1-dev \
34
36
libzip-dev \
37
+ lsof \
35
38
zlib1g-dev \
36
- libasan5 \
39
+ libasan6 \
37
40
gnupg \
38
41
unixodbc-dev \
39
- unixodbc
42
+ unixodbc \
43
+ valgrind
40
44
45
+ # netcat
41
46
ENV RUNTIME_DEPS \
42
47
apache2 \
43
48
apache2-dev \
44
49
ca-certificates \
45
- clang \
46
- clang-format \
47
50
curl \
48
51
debian-goodies \
49
52
gdb \
50
53
git \
51
54
less \
52
55
netbase \
53
- netcat \
54
56
nginx \
55
57
strace \
56
58
sudo \
@@ -64,9 +66,9 @@ ENV PHPIZE_DEPS \
64
66
autoconf \
65
67
bison \
66
68
dpkg-dev \
67
- file \
68
69
g++ \
69
70
gcc \
71
+ file \
70
72
libc-dev \
71
73
make \
72
74
pkg-config \
@@ -84,16 +86,15 @@ RUN set -eux; \
84
86
ulimit -c unlimited; \
85
87
\
86
88
# Ensure debug symbols are available
87
- echo "deb http://deb.debian.org/debian-debug/ buster -debug main" | \
89
+ echo "deb http://deb.debian.org/debian-debug/ bookworm -debug main" | \
88
90
tee -a /etc/apt/sources.list; \
89
91
\
90
- # Use LLVM from orig vendor (also LLVM 16 is not shipped with buster )
92
+ # Use LLVM from orig vendor (also LLVM 16 is not shipped with bookworm )
91
93
apt-get update; \
92
- apt-get install -y curl gnupg; \
93
- echo "deb http://apt.llvm.org/buster/ llvm-toolchain-buster-16 main" >> /etc/apt/sources.list; \
94
- echo "deb-src http://apt.llvm.org/buster/ llvm-toolchain-buster-16 main" >> /etc/apt/sources.list; \
95
- curl https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -; \
94
+ apt-get install -y curl gnupg software-properties-common; \
96
95
curl https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc; \
96
+ add-apt-repository "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-16 main" ; \
97
+ add-apt-repository "deb-src http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-16 main" ; \
97
98
\
98
99
# prevent Debian's PHP packages from being installed
99
100
# https://github.com/docker-library/php/pull/542
@@ -113,11 +114,6 @@ RUN set -eux; \
113
114
$PHPIZE_DEPS \
114
115
$RUNTIME_DEPS; \
115
116
\
116
- # valgrind 3.14 has a fatal bug making it unusable with PHP on arm64, manually install valgrind from bullseye \
117
- curl -O http://ftp.de.debian.org/debian/pool/main/v/valgrind/valgrind_3.16.1-1_${TARGETPLATFORM#linux/}.deb; \
118
- dpkg -i valgrind*.deb; \
119
- rm valgrind*.deb; \
120
- \
121
117
# Disable DST ROOT X3 certificate explicitly to fix conflicts with older openssl versions \
122
118
sed -ri 's/(mozilla\/ DST_Root_CA_X3.crt)/!\1 /' /etc/ca-certificates.conf; \
123
119
update-ca-certificates; \
@@ -131,52 +127,11 @@ RUN set -eux; \
131
127
# Allow nginx to be run as non-root for tests
132
128
chown -R circleci:circleci /var/log/nginx/ /var/lib/nginx/;
133
129
134
- ENV CMAKE_VERSION="3.24.4"
135
-
136
- # Install CMake
137
- RUN set -eux; \
138
- if [ "$(uname -m)" = "aarch64" ]; then \
139
- CMAKE_SHA256="86f823f2636bf715af89da10e04daa476755a799d451baee66247846e95d7bee" ; \
140
- else \
141
- CMAKE_SHA256="cac77d28fb8668c179ac02c283b058aeb846fe2133a57d40b503711281ed9f19" ; \
142
- fi; \
143
- cd /tmp && curl -L --output cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-$(uname -m).tar.gz; \
144
- (echo "${CMAKE_SHA256} cmake.tar.gz" | sha256sum -c -); \
145
- mkdir -p /opt/cmake/${CMAKE_VERSION}; \
146
- tar --strip-components 1 -C /opt/cmake/${CMAKE_VERSION} -xf /tmp/cmake.tar.gz; \
147
- # Currently there's only one version of cmake, make it default
148
- ln -s /opt/cmake/${CMAKE_VERSION}/bin/cmake /usr/local/bin/cmake; \
149
- rm -rfv /tmp/*
150
-
151
- # Install Catch2
152
- RUN set -eux; \
153
- CATCH2_VERSION="2.13.10" ; \
154
- CATCH2_SHA256="d54a712b7b1d7708bc7a819a8e6e47b2fde9536f487b89ccbca295072a7d9943" ; \
155
- cd /tmp && curl -OL https://github.com/catchorg/Catch2/archive/v${CATCH2_VERSION}.tar.gz; \
156
- (echo "${CATCH2_SHA256} v${CATCH2_VERSION}.tar.gz" | sha256sum -c -); \
157
- mkdir catch2 && cd catch2; \
158
- tar -xf ../v${CATCH2_VERSION}.tar.gz --strip 1; \
159
- /opt/cmake/${CMAKE_VERSION}/bin/cmake -Bbuild -H. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/opt/catch2 -DCATCH_BUILD_STATIC_LIBRARY=ON; \
160
- /opt/cmake/${CMAKE_VERSION}/bin/cmake --build build/ --target install; \
161
- rm -rfv /tmp/*
162
-
163
- # Install lcov
164
- RUN set -eux; \
165
- LCOV_VERSION="1.15" ; \
166
- LCOV_SHA256="c1cda2fa33bec9aa2c2c73c87226cfe97de0831887176b45ee523c5e30f8053a" ; \
167
- cd /tmp && curl -OL https://github.com/linux-test-project/lcov/releases/download/v${LCOV_VERSION}/lcov-${LCOV_VERSION}.tar.gz; \
168
- (echo "${LCOV_SHA256} lcov-${LCOV_VERSION}.tar.gz" | sha256sum -c -); \
169
- mkdir lcov && cd lcov; \
170
- tar -xf ../lcov-${LCOV_VERSION}.tar.gz --strip 1; \
171
- make install; \
172
- lcov --version; \
173
- rm -rfv /tmp/*
174
-
175
130
# Install SqlServer PHP Driver
176
131
# https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server
177
132
RUN set -eux; \
178
- curl -s https://packages.microsoft.com/keys/microsoft.asc | apt-key add - ; \
179
- curl -s https://packages.microsoft.com/config/debian/11 /prod.list > /etc/apt/sources.list.d/mssql-release.list; \
133
+ curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg ; \
134
+ curl https://packages.microsoft.com/config/debian/12 /prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list; \
180
135
apt-get update; \
181
136
apt-get install -y \
182
137
msodbcsql18 \
@@ -258,26 +213,19 @@ RUN set -eux; \
258
213
mkdir -p $PHP_INSTALL_DIR; \
259
214
chown -R circleci:circleci /opt;
260
215
261
- # rust sha256sum generated locally after verifying it with sha256
262
216
ARG RUST_VERSION="1.71.1"
263
- ARG RUST_SHA256_ARM= "c7cf230c740a62ea1ca6a4304d955c286aea44e3c6fc960b986a8c2eeea4ec3f"
264
- ARG RUST_SHA256_X86= "34778d1cda674990dfc0537bc600066046ae9cb5d65a07809f7e7da31d4689c4 "
217
+ # Nightly version which kinda matches v1.71.1
218
+ ARG RUST_NIGHTLY_VERSION= "-2023-05-03 "
265
219
# Mount a cache into /rust/cargo if you want to pre-fetch packages or something
266
220
ENV CARGO_HOME=/rust/cargo
267
221
ENV RUSTUP_HOME=/rust/rustup
268
222
RUN mkdir -p -v "${CARGO_HOME}" "${RUSTUP_HOME}" \
269
223
&& chmod -R 777 "${CARGO_HOME}" "${RUSTUP_HOME}" \
270
224
&& MARCH=$(uname -m) \
271
- && RUST_SHA256=$(if [ "$MARCH" = "x86_64" ]; then echo ${RUST_SHA256_X86}; elif [ "$MARCH" = "aarch64" ]; then echo ${RUST_SHA256_ARM}; fi) \
272
- && FILENAME=rust-${RUST_VERSION}-${MARCH}-unknown-linux-gnu.tar.gz \
273
- && curl -L --write-out '%{http_code}' -O https://static.rust-lang.org/dist/${FILENAME} \
274
- && printf '%s %s' "$RUST_SHA256" "$FILENAME" | sha256sum --check --status \
275
- && tar -xf "$FILENAME" \
276
- && cd ${FILENAME%.tar.gz} \
277
- && ./install.sh --components="rustc,cargo,clippy-preview,rustfmt-preview,rust-std-${MARCH}-unknown-linux-gnu" \
278
- && cd - \
279
- && rm -fr "$FILENAME" "${FILENAME%.tar.gz}" \
280
- && rm -rfv /tmp/*
225
+ && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $RUST_VERSION -c "rustc,cargo,clippy-preview,rustfmt-preview,rust-std" \
226
+ && export PATH="/rust/cargo/bin:$PATH" \
227
+ && rustup install nightly${RUST_NIGHTLY_VERSION} \
228
+ && rustup component add rust-src --toolchain nightly${RUST_NIGHTLY_VERSION}-$MARCH-unknown-linux-gnu
281
229
282
230
ENV PATH="/rust/cargo/bin:${PATH}"
283
231
@@ -291,7 +239,7 @@ USER circleci
291
239
292
240
RUN set -eux; \
293
241
# Pretty prompt
294
- echo "PS1='\[\0 33[01;32m\]\u\[\0 33[00m\]\[\0 33[00;35m\] (buster )\[\0 33[00m\] :\[\0 33[01;34m\]\w\[\0 33[00m\]\$ '" | \
242
+ echo "PS1='\[\0 33[01;32m\]\u\[\0 33[00m\]\[\0 33[00;35m\] (bookworm )\[\0 33[00m\] :\[\0 33[01;34m\]\w\[\0 33[00m\]\$ '" | \
295
243
tee -a /home/circleci/.bashrc; \
296
244
# Autocomplete of Makefile targets (see: https://stackoverflow.com/a/38415982)
297
245
echo "complete -W \"\\\` grep -oE '^[a-zA-Z0-9_.-]+:([^=]|$)' ?akefile | sed 's/[^a-zA-Z0-9_.-]*$//'\\\`\" make" | \
0 commit comments