Skip to content

ctu-mrs/mrs_docker-lazy

Repository files navigation

🐢 mrs_docker-lazy

mrs_docker-lazy offers a smooth and efficient workflow for Docker users especially when managing multiple remote machines.


✨ Features

  • 🚀 Simplified workflow
  • 🌐 Scalable across multiple remote machines
  • 🚫 Never SSH: you can work always on your local machine
  • 📡 No Internet needed.

🐳 Requirements

Ensure the following are installed on your local machine:

🛠️ Installation & Setup

1. Clone the Repository

git clone git@github.com:manuelboldrer/mrs_docker-lazy.git ~/git/mrs_docker-lazy

2. Prepare the Remote Machine(s)

  • 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.


🚀 Usage

1. Create and Load Docker Images to Remote Machines

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, and image_loader/load_docker_image.yml, be sure to set the correct image name. (it should be fixed)

2. Compile Workspace (arm64/amd64), Create and Load Docker Images to Remote Machines

Place your workspace inside:

catkin_workspace_uvdar/src

change inventory.ini and common_vars.sh properly and run ./run_all.sh

3. Start TMUX Session

  • Configure tmux_session/session.yml.
  • Run:
cd tmux_session
./start.sh

4. Run in Synchronous Mode

./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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published