mirror of
https://github.com/rui314/mold.git
synced 2024-09-11 21:17:28 +03:00
As recommended in Docker's documentation [^1]: > In addition, when you clean up the apt cache by removing > `/var/lib/apt/lists` it reduces the image size, since the apt cache > is not stored in a layer. This reduces the image size by ~0.5GiB. [^1]: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get Signed-off-by: Zhong Ruoyu <zhongruoyu@outlook.com>
17 lines
751 B
Docker
17 lines
751 B
Docker
# This dockerfile creates a reproducible build environment for mold.
|
|
#
|
|
# $ docker buildx create --use
|
|
# $ docker buildx build --platform x86_64,aarch64 -t rui314/mold-builder:latest --push .
|
|
|
|
FROM ubuntu:20.04
|
|
ENV TZ=Europe/London
|
|
RUN apt-get update && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends software-properties-common gpg-agent wget cmake build-essential g++ && \
|
|
bash -c "$(wget -O - https://apt.llvm.org/llvm.sh) libc++-15-dev" && \
|
|
mkdir /openssl && cd /openssl && \
|
|
wget -O- -q https://www.openssl.org/source/openssl-3.0.7.tar.gz | tar --strip-components=1 -xzf - && \
|
|
./Configure --prefix=/usr/local && \
|
|
make -j$(nproc) && \
|
|
make -j$(nproc) install && \
|
|
rm -rf /var/lib/apt/lists/* /openssl
|