From a7e2acf7b31e06dfe17d678f8a0cb743ecea50a1 Mon Sep 17 00:00:00 2001 From: Simon Roy Date: Wed, 6 Dec 2023 11:27:27 -0500 Subject: [PATCH] fix image name --- .github/workflows/build_container.yml | 2 +- .gitignore | 2 ++ README.md | 18 ++++++++++++------ docker-compose.yml | 8 +++----- sample.env | 7 +++++++ 5 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 .gitignore create mode 100644 sample.env diff --git a/.github/workflows/build_container.yml b/.github/workflows/build_container.yml index 43b5ff2..8d177d0 100644 --- a/.github/workflows/build_container.yml +++ b/.github/workflows/build_container.yml @@ -25,6 +25,6 @@ jobs: - name: Build and push Docker image run: | - IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/your-image-name:latest + IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/gazebo:latest docker build -t $IMAGE_NAME . docker push $IMAGE_NAME diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..896fd06 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# env file +.env \ No newline at end of file diff --git a/README.md b/README.md index d6b674d..03b8bcc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# CAPRA Gazebo +# Docker Gazebo This package contains a working dockerfile/instruction on how to install gazebo using dart 6.13 require for the tracks plugin. @@ -13,16 +13,22 @@ More details on the issue can be found here: https://github.com/gazebosim/gz-sim ## Docker -A cloud image will be available in the next version of the software, but currently, you need to build it. This process can take from 30 min to 1h. +A cloud image will be available in the next version of the software, but currently, you need to build it. This process can take from 30 min to 1h. To save time, you can use the online image available on github. -### Build the image +### Run the image + +*You migth need to change the ROS_DOMAIN_ID to make it work with your system. ```bash -docker compose build +docker compose up ``` -### Run the image +### Build the image + +If you want to modify the image and build it locally, you can use the following command : ```bash -docker compose up +docker compose build ``` + + diff --git a/docker-compose.yml b/docker-compose.yml index 355e518..688822b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,12 @@ version: '3' services: gazebo: + image: ghcr.io/clubcapra/gazebo:latest build: context: . dockerfile: Dockerfile - environment: - - DISPLAY - - QT_X11_NO_MITSHM - - XAUTHORITY - - ROS_DOMAIN_ID=0 + env_file: + - .env volumes: - /tmp/.X11-unix:/tmp/.X11-unix - /tmp/.Xauthority:/tmp/.Xauthority:rw diff --git a/sample.env b/sample.env new file mode 100644 index 0000000..1e91428 --- /dev/null +++ b/sample.env @@ -0,0 +1,7 @@ +# X11 forwarding +DISPLAY=host.docker.internal:0.0 +QT_X11_NO_MITSHM=1 +XAUTHORITY=/tmp/.Xauthority + +# ROS2 domain to avoid conflicts with other containers +ROS_DOMAIN_ID=0 \ No newline at end of file