On this page
More Docker settings
Here are some extra flags for our Docker setup
This is a jetson specific flag and enables GPU use in the container
sudo docker run \
--runtime nvidia \
...
allows certain root privileges in the container. stack overflow explanation
sudo docker run \
--privileged \
...
tricks the Docker container to look like they are running on the host itself. stack overflow explanation
sudo docker run \
--network host \
...
deletes the container after it finishes running. This is more for how limited space is on the jetson.
sudo docker run \
--rm \
...
final settings configuration
#Get the Display number from the DISPLAY variable
DISPLAY_NUMBER=$(echo $DISPLAY | cut -d. -f1 | cut -d: -f2)
# Proxy between the TCP and the Unix domain world, in the background
socat UNIX-LISTEN:/tmp/.X11-unix/X${DISPLAY_NUMBER},fork TCP4:localhost:60${DISPLAY_NUMBER} &
# Expose the "new" display address
export DISPLAY=:$(echo $DISPLAY | cut -d. -f1 | cut -d: -f2)
sudo docker run --rm -it \
--runtime nvidia \
--device /dev/HID-SENSOR-2000e1.4.auto:/dev/HID-SENSOR-2000e1.4.auto \
--device /dev/media1:/dev/media1 \
--device /dev/media2:/dev/media2 \
--device /dev/v4l:/dev/v4l \
--device /dev/video0:/dev/video0 \
--device /dev/video1:/dev/video1 \
--device /dev/video2:/dev/video2 \
--device /dev/video3:/dev/video3 \
--device /dev/video4:/dev/video4 \
--device /dev/video5:/dev/video5 \
--device-cgroup-rule "c 81:* rmw" \
--device-cgroup-rule "c 189:* rmw" \
--device /dev/ttyUSB0 \
--device /dev/ttyUSB1 \
-e DISPLAY=${DISPLAY} \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v ${HOME}/.Xauthority:/root/.Xauthority \
--privileged \
--network host \
-v /home/my_home/my_folder:/my_folder \
my-image bash