-
Notifications
You must be signed in to change notification settings - Fork 18
Docker Help
Kashu Yamazaki edited this page Mar 11, 2024
·
3 revisions
- Allow local X11 connections
xhost local:root
- Run docker with options
- Intel GPU
# Run docker image with following options
docker run --device=/dev/dri:/dev/dri \
-v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY
- NVIDIA GPU
# Run docker image with following options
docker run --gpus 'all,"capabilities=compute,utility,graphics"' \
-v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY
- CPU rendering (without a GPU)
# Run docker image with following options
docker run -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY
use the host machine's network stack directly, instead of creating a separate virtual network for the container.
docker run --network host
With --network host
, you don't need to perform explicit port mapping (-p
or --publish
) because the container's ports are directly exposed on the host machine's network interfaces.
docker run --privileged -v /dev:/dev
The --privileged
flag is a Docker command-line option that gives extended privileges to a Docker container. When you run a container with --privileged
, the container is given almost all the capabilities of the host machine, including direct access to the host's kernel, devices, and other resources.
In order to copy a file from a container to the host, you can use the command
docker cp <containerId>:/file/path/within/container /host/path/target