docker run -d --gpus all --ipc=host --user="$(id -u):$(id -g)" -v ${PWD}/hostdir:/tf --net host --name colab <image>:<tag> docker run --rm --gpus all --ipc=host -v ${PWD}/hostdir:/tf --net host --name colab
–gpus=all: Required if using CUDA, optional otherwise. Passes the graphics cards from the host to the container. You can also more precisely control which graphics cards are exposed using this option (see documentation at https://github.com/NVIDIA/nvidia-docker).
–user="(id−u):(id -g)": Sets the user inside the container to match your user and group ID. Optional, but is useful for writing files with correct ownership.