mrs_docker-lazy offers a smooth and efficient workflow for Docker users especially when managing multiple remote machines.
- 🚀 Simplified workflow
- 🌐 Scalable across multiple remote machines
- 🚫 Never SSH: you can work always on your local machine
- 📡 No Internet needed.
Ensure the following are installed on your local machine:
-
Copy both the private and public SSH keys from
./ssh
to your SSH configuration folder (usually~/.ssh
).
git clone git@github.com:manuelboldrer/mrs_docker-lazy.git ~/git/mrs_docker-lazy
- Install Docker.
./install-docker.sh
- Ensure the public SSH key is added to
~/.ssh/authorized_keys
.
You can use the following command (from your machine):
ssh-copy-id -i ~/.ssh/ansible remote_user@192.168.69.1xx
- Enable remote access to Docker.
./docker-host-settings.sh
or do it manually:
sudo systemctl edit docker.service
Add:
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375 --containerd=/run/containerd/containerd.sock
Then:
sudo systemctl restart docker.service
Verify the service is active.
If do not want to DockerHub or a local registry, a nice alternative is to use Ansible:
- Edit
inventory.ini
to include remote IPs and usernames. - Add your image folder to
load_custom_config/shared_data/
. - Run:
./run_all.sh
⚙️ In
build_image.sh
,export_image.sh
, andimage_loader/load_docker_image.yml
, be sure to set the correct image name. (it should be fixed)
Place your workspace inside:
catkin_workspace_uvdar/src
change inventory.ini
and common_vars.sh
properly and run ./run_all.sh
- Configure
tmux_session/session.yml
. - Run:
cd tmux_session
./start.sh
./up.sh && lazydocker
🐞 Note: Lazydocker can be buggy in showing the logs. Not sure why, in that case you can invoke the custom command
logs
to see the logs of the containers. or go to the stack pane in the Lazydocker session to see all the logs at the same time.
⚙️ You can run custom commands within Lazydocker (check the config in the
lazydocker/
folder). For more check LazyDocker Docs
📡 To not rely on internet you can pull the images from a local registry. For example, run registry.sh, it will create your registry with the alpine image. This is necessary only in cross platform scenarios. In case of both amd64 machine it is sufficient to have the image on your machine.
👜 To save rosbags, first use the custom command added in the lazydocker config.yml (this allow to properly stop the rosbag container, avoiding the .active. If you want to keep the rosbags change the script down.sh in such a way it does not delete volumes.