mirror of
https://github.com/mhx/dwarfs.git
synced 2025-08-03 09:47:01 -04:00
95 lines
2.5 KiB
Docker
95 lines
2.5 KiB
Docker
# syntax=docker/dockerfile:1
|
|
ARG ARCH=amd64
|
|
FROM $ARCH/alpine:latest
|
|
RUN apk update
|
|
RUN apk upgrade
|
|
RUN apk add --no-cache \
|
|
bash-completion \
|
|
build-base \
|
|
wget \
|
|
curl \
|
|
vim \
|
|
tar \
|
|
ripgrep \
|
|
py3-pip \
|
|
less \
|
|
gcc \
|
|
g++ \
|
|
clang18 \
|
|
clang19 \
|
|
git \
|
|
ccache \
|
|
samurai \
|
|
cmake \
|
|
make \
|
|
bison \
|
|
flex \
|
|
ronn \
|
|
fuse \
|
|
fuse-dev \
|
|
fuse-static \
|
|
fuse3 \
|
|
fuse3-dev \
|
|
fuse3-static \
|
|
pkgconf \
|
|
binutils-dev \
|
|
libevent-dev \
|
|
libevent-static \
|
|
linux-headers \
|
|
date-dev \
|
|
range-v3-dev \
|
|
zlib-static \
|
|
libucontext-dev \
|
|
libdwarf-dev \
|
|
elfutils-dev \
|
|
utfcpp \
|
|
nlohmann-json \
|
|
meson \
|
|
autoconf \
|
|
strace \
|
|
gdb
|
|
|
|
# Install UPX
|
|
ARG ARCH
|
|
# UPX isn't supported on RISC-V yet, so skip this
|
|
RUN if [ "$ARCH" != "riscv64" ]; then \
|
|
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"; \
|
|
else \
|
|
echo "Skipping UPX installation for RISC-V architecture while it is not supported."; \
|
|
echo "See https://github.com/upx/upx/discussions/793 for details."; \
|
|
fi
|
|
|
|
# Install mistletoe
|
|
RUN pip3 install --break-system-packages --root-user-action ignore mistletoe
|
|
|
|
# Install size-optimized and static-link-optimized libstdc++
|
|
RUN apk add --no-cache gmp-dev mpfr-dev mpc1-dev isl-dev
|
|
COPY install-libstdcxx.sh /usr/local/bin/install-libstdcxx.sh
|
|
RUN bash /usr/local/bin/install-libstdcxx.sh
|
|
|
|
# Install mold
|
|
COPY install-mold.sh /usr/local/bin/install-mold.sh
|
|
RUN bash /usr/local/bin/install-mold.sh
|
|
|
|
# Install bloaty
|
|
COPY install-bloaty.sh /usr/local/bin/install-bloaty.sh
|
|
RUN if [ "$ARCH" != "riscv64" ]; then \
|
|
bash /usr/local/bin/install-bloaty.sh; \
|
|
else \
|
|
echo "Skipping bloaty installation for RISC-V."; \
|
|
fi
|
|
|
|
# Install all static libraries
|
|
COPY install-static-libs.sh /usr/local/bin/install-static-libs.sh
|
|
RUN bash /usr/local/bin/install-static-libs.sh gcc clang-19 :alpine
|
|
|
|
# Install the *real* ninja...
|
|
# TODO: move this up if we change anything
|
|
RUN apk add --no-cache ninja-build
|
|
|
|
# Set up git & user
|
|
RUN git config --global --add safe.directory /workspace
|
|
RUN adduser -G users -s bash -u 1000 -D mhx
|
|
USER mhx
|
|
ENTRYPOINT /workspace/.docker/build-linux.sh
|