-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_commands.txt
63 lines (31 loc) · 1.02 KB
/
docker_commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Check the version of docker
docker --version
# List all the images present in docker desktop
docker images or docker image ls
# List all the running containers
docker ps
# List all the containers whether running or stopped
docker ps -a
# List the container id of running container
docker ps -q
# List the container ids of running and stopped container
docker ps -a -q
# Pull an image from docker hub
docker pull nginx
# Pull an image with a specified version from docker hub
docker pull nginx:stable-alpine3.17-perl
# Creating a container from the image
docker run nginx
# Stopping the running container
docker stop <container-id>
# Start the stopped container
docker start <container-id>
# Delete the container
docker rm <container-id>
# Removing all the container in one command
docker rm $(docker ps -a -q)
# Removing the running container forcefully
docker rm -f <container-id>
# Port Mapping
docker run -p <host port: container port> nginx
#