diff --git a/.dockerignore b/.dockerignore index 2286ab6ad9..72a1f8649a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,5 @@ +.git +.github +.vscode build build_* diff --git a/.github/workflows/docker-nightly.yml b/.github/workflows/docker-nightly.yml new file mode 100644 index 0000000000..0c09b0ba60 --- /dev/null +++ b/.github/workflows/docker-nightly.yml @@ -0,0 +1,33 @@ +name: nightly docker image builds + +on: + push: + schedule: + - cron: '0 6 * * *' + +jobs: + main: + runs-on: ubuntu-latest + steps: + - uses: docker/setup-buildx-action@v3 + with: + driver: docker + - uses: actions/checkout@v4 + with: + repository: gazebosim/gz-sim + ref: gz-sim9 + path: src + - name: build base image + uses: docker/build-push-action@v6 + with: + file: src/docker/Dockerfile.base + context: src + tags: gz-sim:base + load: true + - name: build nightly image + uses: docker/build-push-action@v6 + with: + file: src/docker/Dockerfile.nightly + build-contexts: | + gz-sim:base=docker-image://gz-sim:base + context: src diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 37e7b94eff..490764ffa5 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -1,4 +1,4 @@ -FROM ubuntu:focal +FROM ubuntu:noble RUN apt-get update \ && apt-get install -y \ @@ -10,6 +10,3 @@ RUN scripts/enable_stable.sh COPY docker/scripts/install_common_deps.sh scripts/install_common_deps.sh RUN scripts/install_common_deps.sh - -COPY docker/scripts/enable_gcc8.sh scripts/enable_gcc8.sh -RUN scripts/enable_gcc8.sh diff --git a/docker/Dockerfile.nightly b/docker/Dockerfile.nightly index 4dee43a1d5..63316c6950 100644 --- a/docker/Dockerfile.nightly +++ b/docker/Dockerfile.nightly @@ -23,7 +23,9 @@ RUN apt-get update \ libgz-gui9-dev \ libgz-msgs11-dev \ libgz-sensors9-dev \ - libsdformat15-dev + libsdformat15-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* COPY . gz-sim RUN cd gz-sim \ diff --git a/docker/README.md b/docker/README.md index b641ee83bb..b038c709a8 100644 --- a/docker/README.md +++ b/docker/README.md @@ -17,6 +17,8 @@ use the Gazebo code found in the current source tree. 1. [Install Docker](#Install-Docker) + You need at least 10GB or free space on a hard drive. + 1. *Optional:* [Install NVidia Docker](#Install-Nvidia-Docker) Nvidia docker will be needed if you plan to run the GUI and/or sensors @@ -46,13 +48,13 @@ use the Gazebo code found in the current source tree. 3. Run the docker image with a bash shell. ``` - docker run -it gz-sim:nightly /bin/bash + docker run --rm -it gz-sim:nightly /bin/bash ``` 4. Alternatively, you can directly run Gazebo using ``` - ./docker/run.bash gz-sim:nightly gz-sim-server -v 4 + ./docker/run.bash gz-sim:nightly gz sim -v 4 ``` ## Gazebo Using Debians In Docker diff --git a/docker/run.bash b/docker/run.bash index cf2ffe4291..e6e68937bd 100755 --- a/docker/run.bash +++ b/docker/run.bash @@ -20,7 +20,7 @@ ARGS=("$@") XAUTH=/tmp/.docker.xauth if [ ! -f $XAUTH ] then - xauth_list=$(xauth nlist :0 | sed -e 's/^..../ffff/') + xauth_list=$(xauth nlist $DISPLAY | sed -e 's/^..../ffff/') if [ ! -z "$xauth_list" ] then echo $xauth_list | xauth -f $XAUTH nmerge - diff --git a/docker/scripts/enable_gcc8.sh b/docker/scripts/enable_gcc8.sh deleted file mode 100755 index 645ab728e4..0000000000 --- a/docker/scripts/enable_gcc8.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -o errexit -set -o verbose - -sudo apt-get install g++-8 - -sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 --slave /usr/bin/gcov gcov /usr/bin/gcov-8 - -gcc -v -g++ -v -gcov -v - -# lcov -git clone https://github.com/linux-test-project/lcov.git -b v1.14 -cd lcov -sudo make install diff --git a/docker/scripts/install_common_deps.sh b/docker/scripts/install_common_deps.sh index 4557350cf2..1b8d637599 100755 --- a/docker/scripts/install_common_deps.sh +++ b/docker/scripts/install_common_deps.sh @@ -17,16 +17,17 @@ sudo apt-get install --no-install-recommends -y \ cppcheck \ curl \ git \ - g++-8 \ - pkg-config \ + g++ \ + lcov \ + pkg-config sudo apt-get install --no-install-recommends -y \ - clang-tidy-6.0 \ - python-yaml \ - libclang-6.0-dev + clang-tidy \ + python3-yaml +# for benchmarks in gz-sim/test/benchmark sudo apt-get install --no-install-recommends -y \ - libbenchmark-dev \ - libbenchmark1 + libbenchmark-dev -sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/* +sudo apt-get clean +sudo rm -rf /var/lib/apt/lists/* diff --git a/test/benchmark/README.md b/test/benchmark/README.md index d73688846d..d5b1d938a1 100644 --- a/test/benchmark/README.md +++ b/test/benchmark/README.md @@ -14,7 +14,7 @@ Given a set of changes to the codebase, it is often useful to see the difference in performance. -Once two (or more) benchmarks have been executed, compare the results by downloading the [benchmark tools](https://github.com/google/benchmark/tree/master/tools), and then run the following command: +Once two (or more) benchmarks have been executed, compare the results by downloading the [benchmark tools](https://github.com/google/benchmark/tree/main/tools), and then run the following command: ``` # From the downloaded "tools" folder