-
Notifications
You must be signed in to change notification settings - Fork 85
/
docker-commands
150 lines (146 loc) · 3.76 KB
/
docker-commands
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
root@ip-172-31-5-43:~# history
1 apt update -y
2 clear
3 uname -a
4 uname -r
5 docker version
6 apt install docker.io -y
7 clear
8 systemctl status docker
9 docker version
10 docker info
11 clear
12 docker pull httpd
13 docker images
14 docker pull tomcat
15 docker images
16 docker ps
17 docker pull fedora
18 clear
19 docker images
20 docker run -itd fedora
21 docker ps
22 docker exec -it c654fc827cda /bin/bash
23 docker ps
24 docker images
25 docker inspect daab1fa13f86
26 docker images
27 docker inspect e4c5c8cc5d55
28 docker images
29 clear
30 docker run -itd -p 82:80 httpd
31 docker ps
32 docker exec -it 2f4727342081 /bin/bash
33 docker stats
34 history
40 docker images
41 docker image ls
42 docker ps
43 docker container ls
44 docker inspect daab1fa13f86
45 docker images
46 docker inspect 51c25da77baf
47 docker images
48 docker run -itd -p 82:80
49 docker run -itd -p 82:80 httpd
50 clear
51 docker ps
52 docker images
53 docker exec -it 2a31a1df4ff3 /bin/bash
54 docker images
55 docker ps
56 docker commit 2a31a1df4ff3 -t httpd_new
57 docker commit 2a31a1df4ff3 httpd_new
58 docker images
59 docker exec -it 2a31a1df4ff3 /bin/bash
60 docker container ls
61 docker stop 2a31a1df4ff3
62 docker ps
63 docker ps -a
64 docker rm 2a31a1df4ff3 2f4727342081 c654fc827cda
65 docker ps -a
66 ls -l
67 mkdir project1
68 cd project1/
69 touch Dockerfile
70 vi Dockerfile
71 cat Dockerfile
72 vi index1.html
73 vi index2.html
74 ls -l
75 cat index1.html
76 cat index2.html
77 cat Dockerfile
78 clear
79 cat Dockerfile
80 docker build . -t httpd1
81 docker images
82 docker run -itd -p 82:80 httpd1
83 docker ps
84 clear
85 docker ps
86 docker inspect b3a598f74a82
87 docker network ls
88 docker inspect 817dfb984e96
89 ls -l
docker ps
93 docker rm -f b3a598f74a82
94 docker ps
95 docker volume ls
96 docker volume create intellipaat-vol
97 docker volume ls
98 docker run -itd --mount source=intellipaat-vol,target=/usr/local/apache2/htdocs -p 82:80 httpd1
99 docker ps
100 docker exec -it fe537ba075d6 /bin/bash
101 docker run -itd --mount source=intellipaat-vol,target=/usr/local/apache2/htdocs -p 83:80 httpd1
102 docker ps
103 docker exec -it ae6747d37ce7 /bin/bash
104 docker ps
105 docker rm -f fe537ba075d6
106 docker exec -it ae6747d37ce7 /bin/bash
107 find / -name intellipaat-vol
108 cd /var/lib/docker/volumes/intellipaat-vol
109 ls -l
110 cd _data
111 ls -l
112 touch dummy.txt
113 echo "this is a dummy file" > dummy.txt
114 cat dummy.txt
115 docker exec -it ae6747d37ce7 /bin/bash
116 cd ~
117 docker images
118 clear
119 docker images
120 docker image tag httpd1:latest raushan8586/intellipaat-march:latest
121 docker image push raushan8586/intellipaat-march:latest
122 docker login
123 docker image push raushan8586/intellipaat-march:latest
docker-compose version
128 apt install docker-compose -y
129 clear
130 docker-compose version
131 ls -l
132 mkdir app1
133 cd app1
134 ls -l
135 vi docker-compose.yaml
136 docker ps
137 ls -l
138 docker-compose up -d
139 docker ps
140 docker exec -it 2991cef05fc8 /bin/bash
141 docker os
142 clear
143 docker ps
144 docker exec -it 2991cef05fc8 /bin/bash
145 docker ps
146 docker logs 2991cef05fc8
147 ls -l
148 docker ps
149 docker logs d5d6ca2e8c61
150 clear
151 docker system df
152 docker system prune -a
153 docker system df
154 docker ps
docker-compose down