# Dockerfile for building Linux static libraries on any platform
# Base image: Ubuntu 22.04 LTS with build essentials
FROM ubuntu:22.04
# Prevent interactive prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
wget \
curl \
zip \
unzip \
pkg-config \
libssl-dev \
zlib1g-dev \
ca-certificates \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Install Rust toolchain (needed for --dev mode: building ccgo from source)
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
ENV PATH="/root/.cargo/bin:${PATH}"
# Set environment variables
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8
# Install ccgo from PyPI (pre-compiled wheel, much faster than cargo install)
RUN pip3 install --no-cache-dir ccgo
# Verify installations
RUN echo "=== Build Tools Verification ===" && \
gcc --version && \
g++ --version && \
cmake --version && \
python3 --version && \
ccgo --version
# Set working directory
WORKDIR /workspace
# Entry point - execute build script
ENTRYPOINT ["/bin/bash", "-c"]