Build the docker file (takes ~500s)
cd go2_ws
sudo docker build -t go2-ros2-sdk:v0.1 .
Enable X11 forwarding on the host machine
xhost +si:localuser:root
Run the docker container
docker run --runtime=nvidia -it\
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $HOME/.Xauthority:/home/$USER/.Xauthority \
-e DISPLAY=$DISPLAY \
go2-ros2-sdk:v0.1
# can add /bin/bash + command at the end
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
&& curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
sed ‘s#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update && apt-get install -y nvidia-docker2
sudo systemctl restart docker
# Test the install
sudo docker run --rm --gpus all nvidia/cuda:11.6.2-base-ubuntu20.04 nvidia-smi
-
Start up script (entrypoint) - see the construct
-
Take in args from docker run command (i.e. ROBOT_IP,CONN_TYPE, etc.)
-
This dockerfile contains secret, which requires the repository settings to allow secret. to change to manual login / token keys? # Set Git access token as an environment variable ENV GIT_ACCESS_TOKEN=
# Install Git and clone private repository RUN apk --no-cache add git \ && git clone https://<You github username>:${GIT_ACCESS_TOKEN}@github.com<Complete github Url>
-
[ ]