Docker Commands

Docker Commands

Here are some of the important docker commands


  1. ?? Run a container:

docker run <image_name>        

2. ??♀? Start a stopped container

docker start <container_id>        

3. ?? Stop a running container

docker stop <container_id>        

4. ?? Restart a container

docker restart <container_id>        

5. ?? Remove a container

docker rm <container_id>        

6. ?? List all containers (running and stopped)

docker ps -a        

7. ?? List Docker images

docker images        

8. ?? Pull a Docker image from a registry

docker pull <image_name>        

9. ?? Push a Docker image to a registry

docker push <image_name>        

10. ?? Build a Docker image from a Dockerfile

docker build -t <image_name> <path_to_Dockerfile_directory        

11.???♂? Docker inspect command to view detailed information about a container or image.

docker inspect [OPTIONS] NAME|ID [NAME|ID...]        

12.?? Docker port command is used to list the port mappings for a container.

docker port CONTAINER [PRIVATE_PORT[/PROTO]]        

13.?? Docker stats command is used to view resource usage statistics for one or more containers.

docker stats [OPTIONS] [CONTAINER...]        

14.?? Docker top command is used to view the processes running inside a container.

docker top CONTAINER [ps OPTIONS]        

15.?? Docker save command is used to save an image to a tar archive.

docker save [OPTIONS] IMAGE [IMAGE...]        









要查看或添加评论,请登录

社区洞察

其他会员也浏览了