- Make a repository based on this template.
- Add the submodules to packages folder (and remove placeholder)
- Update the overlay and dev dependencied (apt and pip) to suit your project.
- Update the
.envfile. - Make sure the entrypoint permissions are set:
chmod +x docker/entrypoint.sh - Build the image (from this repositorys' root folder)
- Start the container.
NB:
- In the overlay image the submodules (in packages folder) are copied over (from the Dockerfile)
- In the dev image the submodules (in packages folder) are a shared volume (from the docker-compose file)
- .devcontainer: vscode setup in container
- Docker: Dockerfile and entrypoint
- .env: Environment variables to be changed. Particularly important for ROS1 (ros master, nodes IP etc.)
- dependencies.repos: Repositories that are used, but not to be modified (e.g. drivers, tools etc)
- docker-compose: Compose file
Install docker and docker compose
Docker: https://docs.docker.com/engine/install/
Docker compose: https://docs.docker.com/compose/install/
Build the image:
docker compose build devRun the container:
docker compose up devConnect to the container:
docker exec -it $NAME bashRemove everything, including stopped containers and all unused images (not just dangling ones):
docker system prune -aClone the repo with submodules:
git clone --recursive git@github.com:Lucasmogsan/ros1_template.gitAlternatively clone the repo and then get the submodules afterwards:
git clone git@github.com:Lucasmogsan/ros1_template.gitgit submodule update --init --recursiveThe main repo has references to the submodules. If these submodules are modified, then the main repo may need to update these references in order to pull the latest data.
git submodule update --remoteThis modifies the references in the main repo, and these changes needs to be comitted and pushed.
Allow user to access the X server inside the docker (see visuals such as rviz inside from the container). On your host PC run the following:
xhost +local:root