# run a docker container
$ docker run {image tag}
# run an docker container on interactive mode
$ docker run -it {image tag} bash
# run a docker container and remove it when it exits
$ docker run --rm {image tag}
# check for running containers
$ docker ps
# check for running containers and non running containers
$ docker ps -a
# start a stoped container
$ docker start {container ID || container name}
# start a stoped container in interactive mode
$ docker start -i {container ID || container name}
# stop a container
$ docker stop {container ID || container name}
# stop all containers
$ docker stop $(docker ps -aq)
# inspect a docker container
$ docker inspect {container ID || container name}
# remove a container
$ docker rm {container ID || container name}
# remove all containers
$ docker rm $(docker ps -aq)
# check changes done inside docker container
$ docker diff {container ID || container name}
# list all local images
$ docker images
# commit changes done on a docker container to create a new image
$ docker commit -a "Alban Kora" -m "Commit message" {container ID || container name} {commit tag}
# Tag to create a repository with the full registry location.
# The location becomes a permanent part of the repository name.
$ docker tag {image id} {local registry}:{image_tag}
# pull an docker image from the registry
$ docker pull {repository_name:image_tag}
# push a new image to a registry
$ docker push {repository_name:image_tag}
# remove an image
$ docker rmi {image ID || image_name:image_tag}
# remove all images
$ docker rmi $(docker images -q)
# show changes history made on an image
$ docker history {image ID || image_name:image_tag}
# list all networks
$ docker network ls
# create a new network
$ docker network create --driver={driver} {name}
# inspect a network
$ docker network inspect {network name}
# remove a docker volume
$ docker network rm {network_name}
# remove all volumes
$ docker network rm $(docker network ls -q)
# list all availiable volumes
$ docker volume ls
# create a local volume and give it a name
$ docker volume create --driver=local --name={name}
# inspect a volume
$ docker volume inspect {volume_name}
# remove a docker volume
$ docker volume rm {volume_name}
# remove all volumes
$ docker volume rm $(docker volume ls -q)
# list all container from the curent docker-compose
$ docker-compose ps
# see the docker compose config file
$ docker-compose config