@@ -143,7 +143,7 @@ RUN conan profile show
143143# Test the image by compiling a simple C++ program.
144144RUN --mount=type=bind,source=test,target=/test,readonly <<EOF
145145cp -r /test test
146- cd test && ./run.sh
146+ cd test && ./run.sh gcc
147147cd ..
148148rm -rf test
149149EOF
@@ -154,19 +154,12 @@ FROM base AS clang
154154# This is not inherited from base image, ensure no manual interaction needed.
155155ARG DEBIAN_FRONTEND=noninteractive
156156
157- # Some build dependencies require GCC to be available.
158- COPY --from=gcc-src /usr/local/ /usr/local/
159- COPY --from=gcc-src /etc/ld.so.conf.d/*.conf /etc/ld.so.conf.d/
157+ # Some build dependencies require GCC to be also available.
160158RUN <<EOF
161- ldconfig -v
162- dpkg-divert --divert /usr/bin/gcc.orig --rename /usr/bin/gcc
163- update-alternatives --install /usr/bin/gcc gcc /usr/local/bin/gcc 100
164- update-alternatives --install \
165- /usr/bin/gcc gcc /usr/local/bin/gcc 100 \
166- --slave /usr/bin/g++ g++ /usr/local/bin/g++ \
167- --slave /usr/bin/gcc-ar gcc-ar /usr/local/bin/gcc-ar \
168- --slave /usr/bin/gcc-nm gcc-nm /usr/local/bin/gcc-nm \
169- --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/local/bin/gcc-ranlib
159+ apt-get update
160+ apt-get install -y --no-install-recommends gcc g++
161+ apt-get clean
162+ rm -rf /var/lib/apt/lists/*
170163EOF
171164
172165# Install Clang. Use the LLVM apt repository to access the latest versions. We
@@ -245,7 +238,7 @@ RUN conan profile show
245238# Test the image by compiling a simple C++ program.
246239RUN --mount=type=bind,source=test,target=/test,readonly <<EOF
247240cp -r /test test
248- cd test && ./run.sh
241+ cd test && ./run.sh clang
249242cd ..
250243rm -rf test
251244EOF
0 commit comments