├── .github ├── FUNDING.yml └── workflows │ ├── docker-image.yml │ └── test.yml ├── Dockerfile ├── Dockerfile_ikpy ├── Dockerfile_webots_cloud ├── README.md └── Webots-R2025a.conf /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [cyberbotics, omichel, stefaniapedrazzi] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | custom: https://cyberbotics.com/buy 10 | -------------------------------------------------------------------------------- /.github/workflows/docker-image.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image CI 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*' 7 | 8 | env: 9 | IMAGE_NAME: webots 10 | CLOUD_IMAGE_NAME: webots.cloud 11 | DEFAULT_WEBOTS_VERSION: R2025a 12 | 13 | jobs: 14 | dockerhub-publication: 15 | runs-on: ubuntu-latest 16 | strategy: 17 | matrix: 18 | BASE_IMAGE: ["nvidia/cuda:11.8.0-base-ubuntu22.04"] 19 | steps: 20 | - uses: actions/checkout@v2 21 | - name: Determine Version 22 | run: | 23 | # Strip git ref prefix from version 24 | IMAGE_TAG=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,' | sed -e 's,\_.*,,') 25 | # Use Docker `latest` tag convention 26 | [ "$IMAGE_TAG" == "master" ] && IMAGE_TAG=latest 27 | # Webots version 28 | [ "$IMAGE_TAG" != "latest" ] && WEBOTS_VERSION=$IMAGE_TAG && IMAGE_TAG=$IMAGE_TAG-$(cut -d'-' -f3 <<<"${{ matrix.BASE_IMAGE }}") 29 | [ "$IMAGE_TAG" == "latest" ] && WEBOTS_VERSION=$DEFAULT_WEBOTS_VERSION 30 | # Display and save 31 | echo IMAGE_TAG=$IMAGE_TAG 32 | echo WEBOTS_VERSION=$WEBOTS_VERSION 33 | echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV 34 | echo "WEBOTS_VERSION=${WEBOTS_VERSION}" >> $GITHUB_ENV 35 | - name: Build the Docker image 36 | run: | 37 | docker build . --file Dockerfile --tag $IMAGE_NAME:$IMAGE_TAG --build-arg WEBOTS_VERSION=$WEBOTS_VERSION --build-arg BASE_IMAGE=${{ matrix.BASE_IMAGE }} --build-arg WEBOTS_PACKAGE_PREFIX=${{ matrix.WEBOTS_PACKAGE_PREFIX }} 38 | docker build . --file Dockerfile_webots_cloud --tag $CLOUD_IMAGE_NAME:$IMAGE_TAG --build-arg WEBOTS_VERSION=$WEBOTS_VERSION --build-arg BASE_IMAGE=$IMAGE_NAME:$IMAGE_TAG 39 | - name: Log into registry 40 | run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login --username=${{ secrets.DOCKER_USERNAME }} --password-stdin 41 | - name: Push image 42 | run: | 43 | docker tag $IMAGE_NAME:$IMAGE_TAG ${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME:$IMAGE_TAG 44 | docker tag $CLOUD_IMAGE_NAME:$IMAGE_TAG ${{ secrets.DOCKER_USERNAME }}/$CLOUD_IMAGE_NAME:$IMAGE_TAG 45 | docker push ${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME:$IMAGE_TAG 46 | docker push ${{ secrets.DOCKER_USERNAME }}/$CLOUD_IMAGE_NAME:$IMAGE_TAG 47 | github-publication: 48 | runs-on: ubuntu-latest 49 | strategy: 50 | matrix: 51 | BASE_IMAGE: ["nvidia/cuda:11.8.0-base-ubuntu22.04"] 52 | if: github.event_name == 'push' 53 | steps: 54 | - uses: actions/checkout@v2 55 | - name: Determine Version 56 | run: | 57 | IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME 58 | CLOUD_IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$CLOUD_IMAGE_NAME 59 | # Change all uppercase to lowercase 60 | IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') 61 | CLOUD_IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') 62 | # Strip git ref prefix from version 63 | IMAGE_TAG=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,' | sed -e 's,\_.*,,') 64 | # Use Docker `latest` tag convention 65 | [ "$IMAGE_TAG" == "master" ] && IMAGE_TAG=latest 66 | # Webots version 67 | [ "$IMAGE_TAG" != "latest" ] && WEBOTS_VERSION=$IMAGE_TAG && IMAGE_TAG=$IMAGE_TAG-$(cut -d'-' -f3 <<<"${{ matrix.BASE_IMAGE }}") 68 | [ "$IMAGE_TAG" == "latest" ] && WEBOTS_VERSION=$DEFAULT_WEBOTS_VERSION 69 | # Display and save 70 | echo IMAGE_ID=$IMAGE_ID 71 | echo CLOUD_IMAGE_ID=$CLOUD_IMAGE_ID 72 | echo IMAGE_TAG=$IMAGE_TAG 73 | echo WEBOTS_VERSION=$WEBOTS_VERSION 74 | echo "IMAGE_ID=${IMAGE_ID}" >> $GITHUB_ENV 75 | echo "CLOUD_IMAGE_ID=${CLOUD_IMAGE_ID}" >> $GITHUB_ENV 76 | echo "IMAGE_TAG=${IMAGE_TAG}-ubuntu${{ matrix.UBUNTU_VERSION }}" >> $GITHUB_ENV 77 | echo "WEBOTS_VERSION=${WEBOTS_VERSION}" >> $GITHUB_ENV 78 | - name: Build image 79 | run: | 80 | docker build . --file Dockerfile --tag $IMAGE_NAME:$IMAGE_TAG --build-arg WEBOTS_VERSION=$WEBOTS_VERSION --build-arg BASE_IMAGE=${{ matrix.BASE_IMAGE }} --build-arg WEBOTS_PACKAGE_PREFIX=${{ matrix.WEBOTS_PACKAGE_PREFIX }} 81 | docker build . --file Dockerfile_webots_cloud --tag $CLOUD_IMAGE_NAME:$IMAGE_TAG --build-arg WEBOTS_VERSION=$WEBOTS_VERSION --build-arg BASE_IMAGE=$IMAGE_NAME:$IMAGE_TAG 82 | - name: Log into registry 83 | run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin 84 | - name: Push image 85 | run: | 86 | docker tag $IMAGE_NAME:$IMAGE_TAG $IMAGE_ID:$IMAGE_TAG 87 | docker push $IMAGE_ID:$IMAGE_TAG 88 | docker tag $CLOUD_IMAGE_NAME:$IMAGE_TAG $CLOUD_IMAGE_ID:$IMAGE_TAG 89 | docker push $CLOUD_IMAGE_ID:$IMAGE_TAG 90 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | push: 5 | 6 | jobs: 7 | # Run tests. 8 | # See also https://docs.docker.com/docker-hub/builds/automated-testing/ 9 | test: 10 | runs-on: ubuntu-latest 11 | strategy: 12 | matrix: 13 | BASE_IMAGE: ["nvidia/cuda:11.8.0-base-ubuntu22.04"] 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Run tests 17 | run: | 18 | if [ -f docker-compose.test.yml ]; then 19 | docker-compose --file docker-compose.test.yml build 20 | docker-compose --file docker-compose.test.yml run sut 21 | else 22 | docker build . --file Dockerfile --build-arg BASE_IMAGE=${{ matrix.BASE_IMAGE }} --build-arg WEBOTS_PACKAGE_PREFIX=${{ matrix.WEBOTS_PACKAGE_PREFIX }} 23 | fi 24 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE=nvidia/cuda:11.8.0-base-ubuntu22.04 2 | FROM ${BASE_IMAGE} AS downloader 3 | 4 | # Determine Webots version to be used and set default argument 5 | ARG WEBOTS_VERSION=R2025a 6 | ARG WEBOTS_PACKAGE_PREFIX= 7 | 8 | # Disable dpkg/gdebi interactive dialogs 9 | ENV DEBIAN_FRONTEND=noninteractive 10 | 11 | RUN apt-get update && apt-get install --yes wget bzip2 && rm -rf /var/lib/apt/lists/ && \ 12 | wget https://github.com/cyberbotics/webots/releases/download/$WEBOTS_VERSION/webots-$WEBOTS_VERSION-x86-64$WEBOTS_PACKAGE_PREFIX.tar.bz2 && \ 13 | tar xjf webots-*.tar.bz2 && rm webots-*.tar.bz2 14 | 15 | FROM ${BASE_IMAGE} 16 | 17 | # Disable dpkg/gdebi interactive dialogs 18 | ENV DEBIAN_FRONTEND=noninteractive 19 | 20 | # Install Webots runtime dependencies 21 | RUN apt-get update && apt-get install --yes wget xvfb locales && rm -rf /var/lib/apt/lists/ && \ 22 | wget https://raw.githubusercontent.com/cyberbotics/webots/master/scripts/install/linux_runtime_dependencies.sh && \ 23 | chmod +x linux_runtime_dependencies.sh && ./linux_runtime_dependencies.sh && rm ./linux_runtime_dependencies.sh && rm -rf /var/lib/apt/lists/ 24 | 25 | # Install Webots 26 | WORKDIR /usr/local 27 | COPY --from=downloader /webots /usr/local/webots/ 28 | ENV QTWEBENGINE_DISABLE_SANDBOX=1 29 | ENV WEBOTS_HOME /usr/local/webots 30 | ENV PATH /usr/local/webots:${PATH} 31 | 32 | # Enable OpenGL capabilities 33 | ENV NVIDIA_DRIVER_CAPABILITIES graphics,compute,utility 34 | 35 | # Set a user name to fix a warning 36 | ENV USER root 37 | 38 | # Set the locales 39 | RUN locale-gen en_US.UTF-8 40 | ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' 41 | 42 | # Finally open a bash command to let the user interact 43 | CMD ["/bin/bash"] 44 | -------------------------------------------------------------------------------- /Dockerfile_ikpy: -------------------------------------------------------------------------------- 1 | FROM cyberbotics/webots.cloud:R2025a-ubuntu24.04 2 | RUN apt-get update && apt-get install -y python3-pip && rm -rf /var/lib/apt/lists/ && pip install --no-cache-dir ikpy 3 | -------------------------------------------------------------------------------- /Dockerfile_webots_cloud: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE=cyberbotics/webots:latest 2 | FROM $BASE_IMAGE AS downloader 3 | 4 | # Determine Webots version to be used and set default argument 5 | ARG WEBOTS_VERSION=R2025a 6 | 7 | RUN apt update && apt install --yes unzip && \ 8 | wget https://github.com/cyberbotics/webots/releases/download/$WEBOTS_VERSION/assets-$WEBOTS_VERSION.zip && \ 9 | mkdir assets && cp assets-$WEBOTS_VERSION.zip assets/ && \ 10 | cd assets && unzip assets-$WEBOTS_VERSION.zip && rm assets-$WEBOTS_VERSION.zip 11 | 12 | FROM $BASE_IMAGE 13 | ARG WEBOTS_VERSION=R2025a 14 | 15 | COPY Webots-R2025a.conf /root/.config/Cyberbotics/Webots-$WEBOTS_VERSION.conf 16 | COPY --from=downloader /usr/local/assets /root/.cache/Cyberbotics/Webots/assets/ 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Webots-Docker 2 | 3 | [![Dockerhub](https://img.shields.io/docker/automated/cyberbotics/webots.svg)](https://hub.docker.com/r/cyberbotics/webots) 4 | [![Test](https://github.com/cyberbotics/webots-docker/workflows/Test/badge.svg)](https://github.com/cyberbotics/webots-docker/actions?query=workflow%3ATest) 5 | [![Docker Image CI](https://github.com/cyberbotics/webots-docker/workflows/Docker%20Image%20CI/badge.svg)](https://github.com/cyberbotics/webots-docker/actions?query=workflow%3A%22Docker+Image+CI%22) 6 | 7 | This repository is used to create a Docker image with Webots already pre-installed. 8 | To use the already available image please follow the [Webots installation instructions](https://cyberbotics.com/doc/guide/installation-procedure#installing-the-docker-image). 9 | 10 | ## Build the Image 11 | 12 | Use the following command to build the docker container from the Dockerfile: 13 | 14 | ``` bash 15 | docker build . --file Dockerfile --tag cyberbotics/webots:latest --build-arg WEBOTS_PACKAGE_PREFIX=_ubuntu-22.04 16 | ``` 17 | 18 | ## Build the Webots.Cloud Images 19 | 20 | Use the following command to build the docker container from the Dockerfile_webots_cloud: 21 | 22 | ``` bash 23 | docker build . --file Dockerfile_webots_cloud --tag cyberbotics/webots.cloud:latest 24 | ``` 25 | 26 | ## Run a Docker container from the Image 27 | 28 | You can run the previously built image with: 29 | 30 | ``` bash 31 | docker run -it cyberbotics/webots:latest /bin/bash 32 | ``` 33 | 34 | ## Clean the temporary Images 35 | 36 | You can run the following command to remove **all** temporary images: 37 | 38 | ``` bash 39 | docker system prune 40 | ``` 41 | -------------------------------------------------------------------------------- /Webots-R2025a.conf: -------------------------------------------------------------------------------- 1 | [Directories] 2 | movies=/root/Videos/ 3 | objects=/root/Documents/ 4 | projects=/root/Documents/ 5 | screenshots=/root/Pictures/ 6 | vrml=/root/Documents/ 7 | www=/root/Documents/ 8 | 9 | [Editor] 10 | font="Monospace, 9" 11 | 12 | [%General] 13 | checkWebotsUpdateOnStartup=true 14 | disableSaveWarning=false 15 | language= 16 | numberOfThreads=8 17 | pythonCommand=python3 18 | rendering=true 19 | startupMode=Real-time 20 | telemetry=false 21 | theme=webots_night.qss 22 | 23 | [Internal] 24 | firstLaunch=false 25 | 26 | [Movie] 27 | acceleration=1 28 | caption=false 29 | quality=90 30 | resolution=6 31 | 32 | [Network] 33 | cacheSize=1024 34 | httpProxyHostName= 35 | httpProxyPassword= 36 | httpProxyPort=0 37 | httpProxyType=2 38 | httpProxyUsername= 39 | uploadUrl=https://webots.cloud 40 | 41 | [OpenGL] 42 | GTAO=0 43 | disableAntiAliasing=true 44 | disableShadows=true 45 | textureFiltering=0 46 | textureQuality=0 47 | 48 | [RobotWindow] 49 | browser= 50 | newBrowserWindow=false 51 | 52 | [Sound] 53 | mute=true 54 | volume=80 55 | 56 | [View3d] 57 | hideAllCameraOverlays=false 58 | hideAllDisplayOverlays=false 59 | hideAllRangeFinderOverlays=false 60 | 61 | [VirtualRealityHeadset] 62 | antiAliasing=false 63 | enable=false 64 | trackOrientation=true 65 | trackPosition=true 66 | visibleEye=left 67 | --------------------------------------------------------------------------------