Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/build_config/docker/Dockerfile.jenkins-build
194762 views
# This is a docker container image to build SUMO
# on the Jenkins CI infrastructure at Eclipse
# (see https://ci.eclipse.org)
#
# It is necessary to build a custom ubuntu image
# since the containers at Eclipse are run without
# root privilege, so we cannot install any packages
# at build time.

# The docker image should be uploaded to ghcr.io
# in order to be used by the Jenkinsfile build.
# This can be achieved with a Personal Access Token.

# 1) IMAGE BUILDING
#
# Build image while being in the repository top folder:
# > docker build \
#    -f build_config/docker/Dockerfile.jenkins-build \
#    -t ghcr.io/eclipse/eclipse-sumo-build-ubuntu:latest \
#    .
#
# OR: Build a multi-architecture image (amd64 + arm64):
# > docker buildx build \
#     --platform linux/amd64,linux/arm64 \
#     -f build_config/docker/Dockerfile.jenkins-build \
#     -t ghcr.io/eclipse/eclipse-sumo-build-ubuntu:latest \
#     .

# 2) IMAGE PUSH TO GHCR REGISTRY
#
# See the following script for a developer with username USERNAME on GitHub
# and a Personal Access Token from GitHub contained in Env-variable GITHUB_PAT:
#
# > echo $GITHUB_PAT | docker login ghcr.io --username USERNAME --password-stdin
#
# > docker push ghcr.io/eclipse/eclipse-sumo-build-ubuntu:latest

# The ubuntu:latest tag points to the "latest LTS"
FROM ubuntu:latest

ENV DEBIAN_FRONTEND=noninteractive

# Make pipx-installed tools (patchelf) available in a stable location
ENV PIPX_HOME=/opt/pipx
ENV PIPX_BIN_DIR=/usr/local/bin
ENV PATH="/usr/local/bin:${PATH}"

# Fixed location for SUMO-related build assets
WORKDIR /opt/sumo

# Copy files early (into /opt/sumo)
COPY build_config/install_dependencies.sh ./install_dependencies.sh
COPY build_config/build_req_deb.txt ./build_req_deb.txt

RUN set -eux; \
    apt-get update; \
    apt-get install -y --no-install-recommends \
        bash \
        ca-certificates \
        curl \
        git \
        python3 \
        python3-pip \
        python3-venv \
        pipx \
    ; \
    chmod +x ./install_dependencies.sh; \
    ./install_dependencies.sh; \
    rm -f ./install_dependencies.sh ./build_req_deb.txt; \
    apt-get autoremove -y; \
    apt-get clean -y; \
    rm -rf /var/cache/apt /var/lib/apt/lists/*