Skip to content

Running VTR3 from a Docker Container

Alec Krawciw edited this page Nov 7, 2023 · 3 revisions

Instructions below install and run VTR3 in a Docker container.

Build docker image with all dependency installed. The following command sets up user and group ids so that you can run the container using the same user id and group id as the host machine instead of root.

cd ${VTRSRC}
docker build -t vtr3 \
  --build-arg USERID=$(id -u) \
  --build-arg GROUPID=$(id -g) \
  --build-arg USERNAME=$(whoami) \
  --build-arg HOMEDIR=${HOME} .

Start a container with the image. You will need to install Docker container runtime first. The following command also connects gpus, system display and host machine network to the container, see Docker documentation for more details.

docker run -it --name vtr3 \
  --privileged \
  --network=host \
  --ipc=host \
  --gpus=all \
  -e DISPLAY=$DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  -v ${VTRROOT}:${VTRROOT}:rw \
  -v /dev:/dev \
  vtr3

Once you've created a docker container, you can access it later with

docker start vtr3
docker exec -it vtr3 bash

If you have multiple containers, change vtr3 to the name of your container.