Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/build_config/docker/Dockerfile.alpine
185785 views
# to build this image run the following command
# $ docker build -t sumo:alpine - < Dockerfile.alpine
# to use it run (GUI applications won't work)
# $ docker run -it sumo:alpine bash
# now you have a bash inside a docker container and can for instance run
# $ cd sumo; bin/sumo -c docs/examples/sumo/busses/test.sumocfg

FROM alpine:latest

RUN apk upgrade --no-cache

# Enable edge installations on apk ref: https://wiki.alpinelinux.org/wiki/Repositories#Using_the_testing_repository_on_stable_branches
RUN echo '@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories

# Build dependencies
RUN apk add bash
RUN apk add --no-cache make
RUN apk add cmake eigen-dev fox-dev@testing g++ gdal-dev gettext git glu-dev mesa-dev mesa-gl proj-dev xerces-c-dev
RUN apk add maven openjdk11-jdk py3-build py3-pip py3-setuptools python3-dev swig

RUN addgroup -g 1001 -S sumo && adduser -u 1001 -S sumo -G sumo
RUN mkdir /opt/sumo && chown sumo /opt/sumo

USER sumo

# Clone the repo
RUN cd /opt/sumo; git clone --shallow-submodules --single-branch --recursive https://github.com/eclipse-sumo/sumo

# Create virtual environment for python packages
RUN python3 -m venv /opt/sumo/venv; \
 . /opt/sumo/venv/bin/activate \
 pip3 install --no-cache -r /opt/sumo/sumo/tools/requirements.txt

WORKDIR /opt/sumo/sumo

# Build and run all examples
RUN cmake -B cmake-build -DCMAKE_INSTALL_PREFIX=/usr -DSUMO_UTILS=TRUE && \
 cd cmake-build && make -j8 all examples doc && \
 sudo make install && cd .. && rm -rf cmake-build