Sunday 26 March 2023

Docker Commands list

Docker Management Commands


docker version     Show the Docker version information

docker info           Show system-wide information about Docker

docker login         Log in to a Docker registry

docker logout       Log out from a Docker registry

docker search       Search for Docker images

docker pull           Pull a Docker image from a registry

docker push         Push a Docker image to a registry

docker build        Build a Docker image from a Dockerfile

docker tag            Create a tag for a Docker image

docker rmi           Remove one or more Docker images

docker images     List all the Docker images on the system

docker ps             List all the running Docker containers

docker ps -a         List all the Docker containers (running and stopped)

docker rm            Remove one or more Docker containers

docker start         Start a stopped Docker container

docker stop          Stop a running Docker container

docker restart      Restart a running Docker container

docker logs         Show the logs of a Docker container

docker exec        Run a command inside a running Docker container

docker port         List the public-facing port of a Docker container

Docker Compose Commands

docker-compose up            Create and start containers

docker-compose down       Stop and remove containers, networks, and volumes

docker-compose build       Build or rebuild services

docker-compose start        Start services

docker-compose stop        Stop services

docker-compose restart     Restart services

docker-compose logs        View output from containers

docker-compose ps          List containers

 

Docker Network Commands

docker network create                Create a Docker network

docker network ls                      List all Docker networks

docker network inspect             Display detailed information about a Docker network

docker network connect            Connect a Docker container to a network

docker network disconnect       Disconnect a Docker container from a network

 

Docker Volume Commands

docker volume create       Create a Docker volume

docker volume ls              List all Docker volumes

docker volume inspect     Display detailed information about a Docker volume

docker volume rm            Remove one or more Docker volumes

 

Docker Swarm Commands

docker swarm init               Initialize a Docker Swarm

docker swarm join              Join a Docker node to a Swarm

docker swarm leave           Leave a Docker Swarm

docker service create         Create a Docker service

docker service ls                List all Docker services

docker service inspect       Display detailed information about a Docker service

docker service update        Update a Docker service

docker service rm              Remove one or more Docker services

 

 

Dockerfile Commands

FROM                   Specifies the base image for the Dockerfile

RUN                       Executes a command in the Docker container

CMD                       Specifies the default command to run when the container starts

EXPOSE                  Exposes a port from the container to the host machine

ENV                         Sets an environment variable

ADD                        Copies files or directories from the host machine to the container

COPY                      Copies files or directories from the host machine to the container

WORKDIR              Sets the working directory for the container

ENTRYPOINT       Specifies the command to run when the container starts

VOLUME               Creates a mount point for a volume

 

Docker Registry Commands

docker login          Log in to a Docker registry

docker logout        Log out from a Docker registry

docker search        Search for Docker images in a registry

docker pull            Pull a Docker image from a registry

docker push          Push a Docker image to a registry

docker tag             Create a tag for a Docker image

 

Docker Stats Command

docker stats        Show live resource usage statistics of running containers

 

Docker Container Commands

docker container create         Create a Docker container

docker container start           Start a stopped Docker container

docker container stop           Stop a running Docker container

docker container restart        Restart a running Docker container

docker container pause         Pause a running Docker container

docker container unpause      Unpause a paused Docker container

docker container rm               Remove one or more Docker containers

docker container ls                 List all running Docker containers

docker container ls -a            List all Docker containers, including stopped ones

 

 

Docker Image Commands

docker image build              Build a Docker image from a Dockerfile

docker image tag                 Tag a Docker image with a name

docker image push              Push a Docker image to a registry

docker image pull                Pull a Docker image from a registry

docker image ls                  List all Docker images

docker image rm                Remove one or more Docker images

 

Docker Compose Commands

docker-compose up           Create and start Docker containers

docker-compose down      Stop and remove Docker containers

docker-compose ps            List all Docker containers managed by Docker Compose

 

Docker System Commands

docker system prune           Remove unused data, such as stopped containers, unused networks, and dangling images

docker system df                 Show Docker disk usage

docker system events         Show real-time events from the Docker daemon

 

 


No comments:

Post a Comment