mirror of
https://github.com/daijro/camoufox.git
synced 2026-09-08 00:00:43 +00:00
1. assets/base.mozconfig: add --disable-debug-symbols. --disable-debug was already set, but that only strips DEBUG code paths; it does not drop -g. So the gkrust fat-LTO staticlib and the libxul link both carried full debug info, which is what puts linux/arm64 container builds into the OOM killer. Nothing in scripts/package.py reads symbol files, so this is pure cost for a release artifact. 2. Dockerfile: install ccache. base.mozconfig enables it only `if command -v ccache >/dev/null`, and the apt list never included it -- so the conditional was always false in-image and every container build was a cold build, despite /root/.mozbuild being a VOLUME. 3. Add .dockerignore. `COPY . /app` was shipping .git and any locally extracted camoufox-*/ tree into the build context. Measured with a scratch `COPY . /app`: context transfer drops from 1.6GB to 988MB (.git alone is 624MB), and a developer with an extracted Firefox tree was previously sending tens of GB. The remaining 931MB is bundle/fonts, which scripts/package.py genuinely reads, so it stays. Verified that nothing in Makefile, multibuild.py, copy-additions.sh, patch.py or package.py references the excluded paths (tests/, build-tester/, service-tester/, docs/, example/). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
37 lines
1016 B
Docker
37 lines
1016 B
Docker
FROM ubuntu:latest
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy the current directory into the container at /app
|
|
COPY . /app
|
|
|
|
# Install necessary packages
|
|
RUN apt-get update && apt-get install -y \
|
|
# Mach build tools
|
|
build-essential make msitools wget unzip rustc \
|
|
# Python
|
|
python3 python3-dev python3-pip \
|
|
# Camoufox build system tools
|
|
git p7zip-full golang-go aria2 curl rsync \
|
|
# assets/base.mozconfig only enables ccache `if command -v ccache`, so
|
|
# without this every container build is a cold build (#698)
|
|
ccache \
|
|
# Platform-specific libraries for Linux builds
|
|
libsqlite3-dev \
|
|
# CA certificates
|
|
ca-certificates \
|
|
&& update-ca-certificates
|
|
|
|
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
# Fetch Firefox & apply initial patches
|
|
RUN make setup-minimal && \
|
|
make mozbootstrap && \
|
|
mkdir -p /app/dist
|
|
|
|
# Mount .mozbuild directory and dist folder
|
|
VOLUME /root/.mozbuild
|
|
VOLUME /app/dist
|
|
|
|
ENTRYPOINT ["python3", "./multibuild.py"] |