0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-13 16:33:53 +01:00

docker: Purge some build packages to slim the built image; refine syntax.

docker: Cleanup for consistent syntax.
This commit is contained in:
Jason Volk 2022-07-17 17:05:58 -07:00
parent 432f38cd06
commit b4cc681112
14 changed files with 237 additions and 165 deletions

View file

@ -3,10 +3,14 @@ FROM jevolk/construct:ubuntu-22.04-base
ENV CC clang-10 ENV CC clang-10
ENV CXX clang++-10 ENV CXX clang++-10
ENV packages="\
clang-10 \
llvm-10-dev \
"
RUN true \ RUN true \
&& apt-get update \ && apt-get update \
&& apt-get install --no-install-recommends -y clang-10 llvm-10-dev \ && apt-get install --no-install-recommends -y ${packages} \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& true && true

View file

@ -3,10 +3,14 @@ FROM jevolk/construct:ubuntu-22.04-base
ENV CC clang-11 ENV CC clang-11
ENV CXX clang++-11 ENV CXX clang++-11
ENV packages="\
clang-11 \
llvm-11-dev \
"
RUN true \ RUN true \
&& apt-get update \ && apt-get update \
&& apt-get install --no-install-recommends -y clang-11 llvm-11-dev \ && apt-get install --no-install-recommends -y ${packages} \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& true && true

View file

@ -3,10 +3,14 @@ FROM jevolk/construct:ubuntu-22.04-base
ENV CC clang-12 ENV CC clang-12
ENV CXX clang++-12 ENV CXX clang++-12
ENV packages="\
clang-12 \
llvm-12-dev \
"
RUN true \ RUN true \
&& apt-get update \ && apt-get update \
&& apt-get install --no-install-recommends -y clang-12 llvm-12-dev \ && apt-get install --no-install-recommends -y ${packages} \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& true && true

View file

@ -3,10 +3,14 @@ FROM jevolk/construct:ubuntu-22.04-base
ENV CC clang-13 ENV CC clang-13
ENV CXX clang++-13 ENV CXX clang++-13
ENV packages="\
clang-13 \
llvm-13-dev \
"
RUN true \ RUN true \
&& apt-get update \ && apt-get update \
&& apt-get install --no-install-recommends -y clang-13 llvm-13-dev \ && apt-get install --no-install-recommends -y ${packages} \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& true && true

View file

@ -3,10 +3,14 @@ FROM jevolk/construct:ubuntu-22.04-base
ENV CC clang-14 ENV CC clang-14
ENV CXX clang++-14 ENV CXX clang++-14
ENV packages="\
clang-14 \
llvm-14-dev \
"
RUN true \ RUN true \
&& apt-get update \ && apt-get update \
&& apt-get install --no-install-recommends -y clang-14 llvm-14-dev \ && apt-get install --no-install-recommends -y ${packages} \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& true && true

View file

@ -1,11 +1,16 @@
FROM jevolk/construct:ubuntu-22.04-base FROM jevolk/construct:ubuntu-22.04-base
ENV CXX g++-10
ENV CC gcc-10 ENV CC gcc-10
ENV CXX g++-10
ENV packages="\
gcc-10 \
g++-10 \
"
RUN true \ RUN true \
&& apt-get update \ && apt-get update \
&& apt-get install --no-install-recommends -y g++-10 gcc-10 \ && apt-get install --no-install-recommends -y ${packages} \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& true && true

View file

@ -1,11 +1,16 @@
FROM jevolk/construct:ubuntu-22.04-base FROM jevolk/construct:ubuntu-22.04-base
ENV CXX g++-11
ENV CC gcc-11 ENV CC gcc-11
ENV CXX g++-11
ENV packages="\
gcc-11 \
g++-11 \
"
RUN true \ RUN true \
&& apt-get update \ && apt-get update \
&& apt-get install --no-install-recommends -y g++-11 gcc-11 \ && apt-get install --no-install-recommends -y ${packages} \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& true && true

View file

@ -1,11 +1,16 @@
FROM jevolk/construct:ubuntu-22.04-base FROM jevolk/construct:ubuntu-22.04-base
ENV CXX g++-12
ENV CC gcc-12 ENV CC gcc-12
ENV CXX g++-12
ENV packages="\
gcc-12 \
g++-12 \
"
RUN true \ RUN true \
&& apt-get update \ && apt-get update \
&& apt-get install --no-install-recommends -y g++-12 gcc-12 \ && apt-get install --no-install-recommends -y ${packages} \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& true && true

View file

@ -1,11 +1,16 @@
FROM jevolk/construct:ubuntu-22.04-base FROM jevolk/construct:ubuntu-22.04-base
ENV CXX g++-8
ENV CC gcc-8 ENV CC gcc-8
ENV CXX g++-8
ENV packages="\
gcc-8 \
g++-8 \
"
RUN true \ RUN true \
&& apt-get update \ && apt-get update \
&& apt-get install --no-install-recommends -y g++-8 gcc-8 \ && apt-get install --no-install-recommends -y ${packages} \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& true && true

View file

@ -1,11 +1,16 @@
FROM jevolk/construct:ubuntu-22.04-base FROM jevolk/construct:ubuntu-22.04-base
ENV CXX g++-9
ENV CC gcc-9 ENV CC gcc-9
ENV CXX g++-9
ENV packages="\
gcc-9 \
g++-9 \
"
RUN true \ RUN true \
&& apt-get update \ && apt-get update \
&& apt-get install --no-install-recommends -y g++-9 gcc-9 \ && apt-get install --no-install-recommends -y ${packages} \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& true && true

View file

@ -2,9 +2,7 @@ FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN true \ ENV packages="\
&& apt-get update \
&& apt-get install --no-install-recommends -y \
autoconf \ autoconf \
autoconf-archive \ autoconf-archive \
autoconf2.13 \ autoconf2.13 \
@ -29,29 +27,15 @@ RUN true \
libzstd-dev \ libzstd-dev \
shtool \ shtool \
xz-utils \ xz-utils \
&& update-ca-certificates \ "
&& apt-get clean \
&& apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/* \
&& true
ENV ROCKSDB_VERSION=6.11.4 ENV purges="\
ARG skiprocks cmake \
curl \
"
RUN true \ ENV rocks_version=6.11.4
&& if test -n "$skiprocks"; then \ ENV rocks_cmake="\
exit 0; \
fi \
&& cd /usr/src \
&& curl -sL https://codeload.github.com/facebook/rocksdb/tar.gz/refs/tags/v${ROCKSDB_VERSION} -o rocksdb-${ROCKSDB_VERSION}.tar.gz \
&& tar xfvz rocksdb-${ROCKSDB_VERSION}.tar.gz \
&& rm rocksdb-${ROCKSDB_VERSION}.tar.gz \
&& ln -s /usr/src/rocksdb-${ROCKSDB_VERSION} /usr/src/rocksdb \
&& cd /usr/src/rocksdb-${ROCKSDB_VERSION} \
&& \
CFLAGS="-g0" \
LDFLAGS="-Wl,--strip-all" \
cmake -H. -Bbuild \
-DCMAKE_RULE_MESSAGES:BOOL=OFF \ -DCMAKE_RULE_MESSAGES:BOOL=OFF \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DWITH_JNI=0 \ -DWITH_JNI=0 \
@ -66,15 +50,39 @@ RUN true \
-DWITH_ZSTD=1 \ -DWITH_ZSTD=1 \
-DUSE_RTTI=1 \ -DUSE_RTTI=1 \
-DBUILD_SHARED_LIBS=1 \ -DBUILD_SHARED_LIBS=1 \
&& cmake --build build --target install \ "
RUN true \
&& apt-get update \
&& apt-get install --no-install-recommends -y ${packages}\
&& update-ca-certificates \
&& apt-get clean \
&& apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /build \
&& true
ARG skiprocks
RUN true \
&& if test -n "$skiprocks"; then \
exit 0; \
fi \
&& cd /usr/src \
&& curl -sL https://codeload.github.com/facebook/rocksdb/tar.gz/refs/tags/v${rocks_version} -o rocksdb-${rocks_version}.tar.gz \
&& tar xfvz rocksdb-${rocks_version}.tar.gz \
&& rm rocksdb-${rocks_version}.tar.gz \
&& ln -s /usr/src/rocksdb-${rocks_version} /usr/src/rocksdb \
&& cd /usr/src/rocksdb-${rocks_version} \
&& \
CFLAGS="-g0" \
LDFLAGS="-Wl,--strip-all" \
cmake -H. -Bbuild ${rocks_cmake} \
&& cmake --build build --target install --parallel `nproc` \
&& rm -rf build \ && rm -rf build \
&& apt-get purge -y \ && apt-get purge -y ${purges} \
cmake \
curl \
&& apt-get clean \ && apt-get clean \
&& apt-get autoremove --purge -y \ && apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& true && true
RUN mkdir /build
WORKDIR /build WORKDIR /build

View file

@ -1,5 +1,19 @@
FROM jevolk/construct:ubuntu-22.04-full-clang-14 FROM jevolk/construct:ubuntu-22.04-full-clang-14
ENV purges="\
autoconf \
autoconf-archive \
autoconf2.13 \
automake \
autotools-dev \
build-essential \
clang-14 \
git \
libtool \
llvm-14-dev \
shtool \
"
RUN true \ RUN true \
&& git clone https://github.com/jevolk/charybdis.git \ && git clone https://github.com/jevolk/charybdis.git \
&& cd charybdis \ && cd charybdis \
@ -11,7 +25,7 @@ RUN true \
&& make install \ && make install \
&& cd .. \ && cd .. \
&& rm -rf charybdis \ && rm -rf charybdis \
&& apt-get purge -y clang-14 llvm-14-dev \ && apt-get purge -y ${purges} \
&& apt-get autoremove --purge -y \ && apt-get autoremove --purge -y \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \

View file

@ -3,10 +3,14 @@ FROM jevolk/construct:ubuntu-22.04-full
ENV CC clang-14 ENV CC clang-14
ENV CXX clang++-14 ENV CXX clang++-14
ENV packages="\
clang-14 \
llvm-14-dev \
"
RUN true \ RUN true \
&& apt-get update \ && apt-get update \
&& apt-get install --no-install-recommends -y clang-14 llvm-14-dev \ && apt-get install --no-install-recommends -y ${packages} \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& true && true

View file

@ -1,16 +1,17 @@
FROM jevolk/construct:ubuntu-22.04-base FROM jevolk/construct:ubuntu-22.04-base
ENV DEBIAN_FRONTEND=noninteractive ENV packages="\
RUN true \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
opencl-headers \ opencl-headers \
libgraphicsmagick1-dev \ libgraphicsmagick1-dev \
libicu-dev \ libicu-dev \
libjemalloc-dev \ libjemalloc-dev \
libopencl-clang-dev \ libopencl-clang-dev \
libpng-dev \ libpng-dev \
"
RUN true \
&& apt-get update \
&& apt-get install --no-install-recommends -y ${packages} \
&& apt-get clean \ && apt-get clean \
&& apt-get autoremove --purge -y \ && apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \