-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstall_DockerROS2Humble
61 lines (53 loc) · 2.99 KB
/
Install_DockerROS2Humble
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
This documents is to use Docker with ros2
Good resume of what is Docker: It's to solved the "it's working on my machine" problem. Like virtualbox
Install official Docker:
#if you have install an unofficial docker (ex: docker.io) please uninstall it with this command: for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
sudo apt install gnome-terminal
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
#Download latest DEB package : https://desktop.docker.com/linux/main/amd64/docker-desktop-4.26.1-amd64.deb?utm_source=docker&utm_medium=webreferral&utm_campaign=docs-driven-download-linux-amd64&_gl=1*bvw20g*_ga*MTI1ODYzODIuMTcwNDg5OTkwNA..*_ga_XJWPQMJYHQ*MTcwNTQyNzM5Ny42LjEuMTcwNTQzMjc3Ny41NS4wLjA.
sudo apt-get install ./docker-desktop-<version>-<arch>.deb
#to login you must have a pass and active VMX on your BIOS :
gpg --generate-key
pass init <yourkey>
#install last docker package : sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
use Docker without sudo :
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
#Verify that the Docker Engine installation is successful : sudo docker run hello-world
service docker start
docker ps
docker images
Pull Ros2 Humble desktop image:
docker pull osrf/ros:humble-desktop-full-jammy
docker pull tiryoh/ros2-desktop-vnc:humble
Without zerotier : docker run -it -p 6080:80 -v ~/documents/ros-docker --name Docker_humble_Rosie --security-opt seccomp=unconfined tiryoh/ros2-desktop-vnc:humble
with zerotier : docker run -it --cap-add=NET_ADMIN --cap-add=SYS_ADMIN --device=/dev/net/tun -p 6080:80 -v ~/documents/ros-docker --name Docker_humble_Rosie_WithZerotier --security-opt seccomp=unconfined tiryoh/ros2-desktop-vnc:humble
# -it = interactif terminal
# Go to a webpage and write this link: http://localhost:6080/
# To know the version of ros : ls -lh /opt/ros/
Commit :
sudo docker ps
#take ID of your container
sudo docker commit <ID> <Repository:Tag>
#Now you can see it : sudo docker images
sudo docker save -o <path>/<NameYouWouldLike>.tar <Repository:Tag>
#take the file to another machine
sudo docker load -i <pathOnNewMachine>/<NameYouWouldLike>.tar
#Now you can see it on new machine: sudo docker images
START with ID:
docker exec -it test /bin/bash
sudo docker ps -a #take ID of your container
docker start <ID>
docker attach <ID>