Skip to content
Ray Zhang edited this page Mar 11, 2022 · 3 revisions

What is a docker image? What is a docker container?

Stackoverflow answer

Install Docker CE

https://docs.docker.com/v17.09/engine/installation/linux/docker-ce/ubuntu/#install-docker-ce

Install nvidia-docker 2.0

https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0)

Manage Docker as a non-root user

https://docs.docker.com/install/linux/linux-postinstall/

Download a TensorFlow Docker image

https://www.tensorflow.org/install/docker#download_a_tensorflow_docker_image

Create a container (example)

git clone [email protected]:UMich-CURLY/docker_images.git

cd semantic_mapping_melodic

docker build --tag umrobotics/semantic_mapping_melodic .

bash run_cuda_docker.bash [container_name]

Open the container

docker ps -a This will give you all the containers you have created. Choose the one you need to open.

docker exec -it [container_name] /bin/bash

GUI support inside docker

If you want use GUI, you can try xhost local:root before running docker exec -it [container_name] /bin/bash. It's not secure, but still a temp workaround.

If you need to use sudo, just enter docker as root

docker exec -u root -it [container_name] /bin/bash

when you restart the machine and need to start your old docker container

docker ps -a --> Find you old container name

docker start [container_name]

The way to mount your disk to a container

How to use Tmux and Docker together?

It is recommended to open a new tmux session first, and open docker container inside tmux.