build: update alpine dockerfile

This commit is contained in:
Marcus Holland-Moritz 2025-04-01 19:50:44 +02:00
parent 4e0ea2c165
commit c109cef774
3 changed files with 31 additions and 5 deletions

View File

@ -82,10 +82,12 @@ ARG ARCH
RUN wget -O - https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-$(bash -c "echo \${0//v8/}" $ARCH)_linux.tar.xz | tar -xJf - -C /usr/local/bin --strip-components=1 --wildcards "*/upx" RUN wget -O - https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-$(bash -c "echo \${0//v8/}" $ARCH)_linux.tar.xz | tar -xJf - -C /usr/local/bin --strip-components=1 --wildcards "*/upx"
RUN pip3 install --break-system-packages --root-user-action ignore mistletoe RUN pip3 install --break-system-packages --root-user-action ignore mistletoe
RUN git config --global --add safe.directory /workspace RUN git config --global --add safe.directory /workspace
COPY install-static-libs.sh /usr/local/bin/install-static-libs.sh
RUN bash /usr/local/bin/install-static-libs.sh gcc clang-18 :alpine
COPY install-mold.sh /usr/local/bin/install-mold.sh COPY install-mold.sh /usr/local/bin/install-mold.sh
RUN bash /usr/local/bin/install-mold.sh RUN bash /usr/local/bin/install-mold.sh
COPY install-bloaty.sh /usr/local/bin/install-bloaty.sh
RUN bash /usr/local/bin/install-bloaty.sh
COPY install-static-libs.sh /usr/local/bin/install-static-libs.sh
RUN bash /usr/local/bin/install-static-libs.sh gcc clang-18 :alpine
RUN adduser -G users -s bash -u 1000 -D mhx RUN adduser -G users -s bash -u 1000 -D mhx
USER mhx USER mhx
ENTRYPOINT /workspace/.docker/build-linux.sh ENTRYPOINT /workspace/.docker/build-linux.sh

19
.docker/install-bloaty.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/bash
set -ex
cd "$HOME"
mkdir pkgs
cd pkgs
git clone --recurse-submodules https://github.com/google/bloaty
cd bloaty
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local
ninja
ninja install
cd "$HOME"
rm -rf pkgs

View File

@ -18,7 +18,7 @@ FLAC_VERSION=1.5.0
# TODO: https://github.com/libunwind/libunwind/issues/702 # TODO: https://github.com/libunwind/libunwind/issues/702
LIBUNWIND_VERSION=1.7.2 LIBUNWIND_VERSION=1.7.2
BENCHMARK_VERSION=1.9.1 BENCHMARK_VERSION=1.9.1
OPENSSL_VERSION=3.0.16 OPENSSL_VERSION=3.3.3
CPPTRACE_VERSION=0.8.2 CPPTRACE_VERSION=0.8.2
DOUBLE_CONVERSION_VERSION=3.3.1 DOUBLE_CONVERSION_VERSION=3.3.1
FMT_VERSION=11.1.4 FMT_VERSION=11.1.4
@ -32,7 +32,7 @@ echo "Using $GCC and $CLANG"
if [[ "$PKGS" == ":ubuntu" ]]; then if [[ "$PKGS" == ":ubuntu" ]]; then
PKGS="file,bzip2,libarchive,flac,libunwind,benchmark,openssl,cpptrace" PKGS="file,bzip2,libarchive,flac,libunwind,benchmark,openssl,cpptrace"
elif [[ "$PKGS" == ":alpine" ]]; then elif [[ "$PKGS" == ":alpine" ]]; then
PKGS="benchmark,brotli,cpptrace,double-conversion,flac,fmt,glog,libarchive,lz4,xxhash" PKGS="benchmark,brotli,bzip2,cpptrace,double-conversion,flac,fmt,glog,libarchive,lz4,openssl,xxhash"
export CFLAGS="-Os -ffunction-sections -fdata-sections -fmerge-all-constants" export CFLAGS="-Os -ffunction-sections -fdata-sections -fmerge-all-constants"
export CXXFLAGS="$CFLAGS" export CXXFLAGS="$CFLAGS"
elif [[ "$PKGS" == ":none" ]]; then elif [[ "$PKGS" == ":none" ]]; then
@ -141,7 +141,12 @@ for COMPILER in clang gcc; do
cd "$HOME/pkgs/$COMPILER" cd "$HOME/pkgs/$COMPILER"
tar xf ../${OPENSSL_TARBALL} tar xf ../${OPENSSL_TARBALL}
cd openssl-${OPENSSL_VERSION} cd openssl-${OPENSSL_VERSION}
./Configure --prefix="$INSTALL_DIR" --libdir=lib threads no-fips no-shared no-pic no-dso ./Configure --prefix="$INSTALL_DIR" --libdir=lib threads no-fips no-shared no-pic no-dso no-aria no-async no-atexit \
no-autoload-config no-blake2 no-bf no-camellia no-cast no-chacha no-cmac no-cms no-cmp no-comp no-ct no-des \
no-dgram no-dh no-dsa no-ec no-engine no-filenames no-idea no-ktls no-md4 no-multiblock \
no-nextprotoneg no-ocsp no-ocb no-poly1305 no-psk no-rc2 no-rc4 no-seed no-siphash no-siv no-sm3 no-sm4 \
no-srp no-srtp no-ssl3-method no-ssl-trace no-tfo no-ts no-ui-console no-whirlpool no-fips-securitychecks
make -j$(nproc) make -j$(nproc)
make install_sw make install_sw
fi fi