j3soon / ros2-essentials

A repo containing essential ROS2 (Humble) features for controlling Autonomous Mobile Robots (AMRs).
Apache License 2.0
7 stars 3 forks source link

Replace the service name in docker compose file. #20

Closed YuZhong-Chen closed 10 months ago

YuZhong-Chen commented 10 months ago

If the docker service name is the same, the compose file that runs second will recreate the first file's container. This may lead to issues such as data loss when opening the second container simultaneously.

There are two possible solutions: one is to replace the service name in the compose file, and the other is to add the parameter --project-name to specify an alternate project name for docker compose. I chose the first solution in this pull request because it is easier to understand.

Reference: https://github.com/docker/compose/issues/7403

j3soon commented 10 months ago

Some additional context (as discussed offline):