0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 23:14:13 +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 CXX clang++-10
RUN true \
&& apt-get update \
&& apt-get install --no-install-recommends -y clang-10 llvm-10-dev \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& true
ENV packages="\
clang-10 \
llvm-10-dev \
"
RUN true \
&& apt-get update \
&& apt-get install --no-install-recommends -y ${packages} \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& true

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,79 +2,87 @@ FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN true \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
autoconf \
autoconf-archive \
autoconf2.13 \
automake \
autotools-dev \
build-essential \
ca-certificates \
cmake \
curl \
git \
libboost-chrono1.74-dev \
libboost-context1.74-dev \
libboost-coroutine1.74-dev \
libboost-system1.74-dev \
libboost-thread1.74-dev \
liblz4-dev \
libnss-db \
libmagic-dev \
libsodium-dev \
libssl-dev \
libtool \
libzstd-dev \
shtool \
xz-utils \
&& update-ca-certificates \
&& apt-get clean \
&& apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/* \
&& true
ENV packages="\
autoconf \
autoconf-archive \
autoconf2.13 \
automake \
autotools-dev \
build-essential \
ca-certificates \
cmake \
curl \
git \
libboost-chrono1.74-dev \
libboost-context1.74-dev \
libboost-coroutine1.74-dev \
libboost-system1.74-dev \
libboost-thread1.74-dev \
liblz4-dev \
libnss-db \
libmagic-dev \
libsodium-dev \
libssl-dev \
libtool \
libzstd-dev \
shtool \
xz-utils \
"
ENV purges="\
cmake \
curl \
"
ENV rocks_version=6.11.4
ENV rocks_cmake="\
-DCMAKE_RULE_MESSAGES:BOOL=OFF \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DWITH_JNI=0 \
-DWITH_TESTS=0 \
-DWITH_BENCHMARK_TOOLS=0 \
-DWITH_CORE_TOOLS=0 \
-DFAIL_ON_WARNINGS=0 \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_GFLAGS=0 \
-DWITH_LIBURING=0 \
-DWITH_LZ4=1 \
-DWITH_ZSTD=1 \
-DUSE_RTTI=1 \
-DBUILD_SHARED_LIBS=1 \
"
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
ENV ROCKSDB_VERSION=6.11.4
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${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_VERBOSE_MAKEFILE:BOOL=ON \
-DWITH_JNI=0 \
-DWITH_TESTS=0 \
-DWITH_BENCHMARK_TOOLS=0 \
-DWITH_CORE_TOOLS=0 \
-DFAIL_ON_WARNINGS=0 \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_GFLAGS=0 \
-DWITH_LIBURING=0 \
-DWITH_LZ4=1 \
-DWITH_ZSTD=1 \
-DUSE_RTTI=1 \
-DBUILD_SHARED_LIBS=1 \
&& cmake --build build --target install \
&& rm -rf build \
&& apt-get purge -y \
cmake \
curl \
&& apt-get clean \
&& apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/* \
&& 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 \
&& apt-get purge -y ${purges} \
&& apt-get clean \
&& apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/* \
&& true
RUN mkdir /build
WORKDIR /build

View file

@ -1,18 +1,32 @@
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 \
&& git clone https://github.com/jevolk/charybdis.git \
&& cd charybdis \
&& rmdir -v deps/rocksdb \
&& ln -sv /usr/src/rocksdb deps \
&& ./autogen.sh \
&& ./configure \
&& make -j `nproc` \
&& make install \
&& cd .. \
&& rm -rf charybdis \
&& apt-get purge -y clang-14 llvm-14-dev \
&& apt-get autoremove --purge -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& true
&& git clone https://github.com/jevolk/charybdis.git \
&& cd charybdis \
&& rmdir -v deps/rocksdb \
&& ln -sv /usr/src/rocksdb deps \
&& ./autogen.sh \
&& ./configure \
&& make -j `nproc` \
&& make install \
&& cd .. \
&& rm -rf charybdis \
&& apt-get purge -y ${purges} \
&& apt-get autoremove --purge -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& true

View file

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

View file

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