Skip to content

Docker Documentation

Mohandass Muthuraja edited this page Oct 6, 2020 · 5 revisions

Docker Commands

Building Docker image

docker build -t <IMG_NAME>:<TAG_NAME> . --no-cache=true

Run Docker container

docker run --gpus all -it --rm -v pwd/<DIR>:/home/<DIR> <IMG_NAME>:<TAG_NAME> bash

Detach the container that run in -it mode

Ctrl + P , Ctrl + Q

Detach the container that run in -it mode

docker attach CONTAINER_NAME

Pull a docker image

docker pull <IMAGE_NAME>

Docker Execute on a running container

docker exec -it <CONTAINER_NAME> bash

List the docker images

docker images

List the Running containers

docker container ls

Kill the Running containers

docker kill <CONATAINER_ID>

Restart the system docker

sudo systemctl restart docker

Clone this wiki locally