docker commands
Docker Container Commands
docker run [OPTIONS] IMAGE [COMMAND] [ARG...] : Run a command in a new container.
docker start [OPTIONS] CONTAINER : Start one or more stopped containers.
docker stop [OPTIONS] CONTAINER : Stop one or more running containers.
docker restart [OPTIONS] CONTAINER : Restart one or more containers.
docker kill [OPTIONS] CONTAINER : Kill one or more running containers.
docker rm [OPTIONS] CONTAINER : Remove one or more containers.
docker exec [OPTIONS] CONTAINER COMMAND [ARG...] : Run a command in a running
container.
docker logs [OPTIONS] CONTAINER : Fetch the logs of a container.
docker ps [OPTIONS] : List containers.
docker inspect [OPTIONS] CONTAINER : Display detailed information on one or more
containers.
Docker Image Commands
docker pull [OPTIONS] NAME[:TAG|@DIGEST] : Pull an image or a repository from a
registry.
docker push [OPTIONS] NAME[:TAG] : Push an image or a repository to a registry.
docker build [OPTIONS] PATH | URL | - : Build an image from a Dockerfile.
docker images [OPTIONS] [REPOSITORY[:TAG]] : List images.
docker rmi [OPTIONS] IMAGE [IMAGE...] : Remove one or more images.
SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG] : Create a tag TARGET_IMAGE that refers to
SOURCE_IMAGE.
Docker Network Commands
docker commands 1
docker network ls : List networks.
docker network create [OPTIONS] NETWORK : Create a network.
docker network rm NETWORK : Remove one or more networks.
docker network inspect NETWORK : Display detailed information on one or more
networks.
docker network connect [OPTIONS] NETWORK CONTAINER : Connect a container to a
network.
docker network disconnect [OPTIONS] NETWORK CONTAINER : Disconnect a container from a
network.
Docker Volume Commands
docker volume ls : List volumes.
docker volume create [OPTIONS] [VOLUME] : Create a volume.
docker volume rm VOLUME : Remove one or more volumes.
docker volume inspect VOLUME : Display detailed information on one or more volumes.
Docker Compose Commands
docker-compose up [OPTIONS] [SERVICE...] : Build, create, start, and attach to containers
for a service.
docker-compose down [OPTIONS] : Stop and remove containers, networks, images,
and volumes.
docker-compose build [OPTIONS] [SERVICE...] : Build or rebuild services.
docker-compose ps : List containers.
docker-compose logs [OPTIONS] [SERVICE...] : View output from containers.
docker-compose exec [OPTIONS] SERVICE COMMAND [ARGS...] : Execute a command in a
running service container.
Docker System Commands
docker system prune [OPTIONS] : Remove unused data (containers, images, networks,
volumes).
docker commands 2
docker system df : Show docker disk usage.
docker system info : Display system-wide information.\
docker stop $(docker ps -aq)
docker commands 3