Skip to content

Commit

Permalink
Create commands
Browse files Browse the repository at this point in the history
  • Loading branch information
leaddevops authored Nov 26, 2024
1 parent ef9b8bf commit 808ac55
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions docker/networks/commands
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
246 docker pull lerndevops/samples:netshoot
247 docker image ls
248 docker run -d --name cont1 lerndevops/samples:netshoot
249 docker run -d --name cont2 lerndevops/samples:netshoot
250 docker ps
251 docker inspect cont1
252 docker inspect cont1 | grep -i ipaddr
253 docker inspect cont2 | grep -i ipaddr
254 sudo systemctl status docker.service
255 docker network ls
256 docker network inspect bridge
257 docker ps
258 docker exec cont1 hostname -i
259 docker exec cont2 hostname -i
260 docker exec cont2 ping 172.17.0.2
261 docker exec cont1 ping 172.17.0.3
262 docker network ls
263 docker network create mynet --driver bridge --subnet 19.43.0.0/16 --gateway 19.43.0.1
264 docker network ls
265 docker network inspect mynet
266 docker run -d --name cont3 --network mynet lerndevops/samples:netshoot
267 docker run -d --name cont4 --network mynet lerndevops/samples:netshoot
268 docker network ls
269 docker ps
270 docker exec cont3 hostname -i
271 docker exec cont4 hostname -i
272 docker exec cont1 hostname -i
273 docker exec cont2 hostname -i
274 docker exec cont3 ping 19.43.0.3
275 docker exec cont4 ping 19.43.0.2
276 docker exec cont4 ping 172.17.0.2
277 docker inspect cont1
278 docker inspect cont3
279 docker exec cont1 ping cont3
280 docker exec cont1 ping 19.43.0.2
281 docker exec cont1 ifconfig
282 docker network connect mynet cont1
283 docker exec cont1 ifconfig
284 docker exec cont1 ping 19.43.0.2
285 docker exec cont1 ping 19.43.0.3
286 docker exec cont1 ifconfig
287 docker network disconnect mynet cont1
288 docker exec cont1 ifconfig
289 docker exec cont1 ping 19.43.0.3
290 docker network ls
291 docker network disconnect bridge cont1
292 docker exec cont1 ifconfig
293 docker run -d --name cont5 --network host lerndevops/samples:netshoot
294 docker ps
295 hostname -i
296 docker exec cont5 hostname -i

0 comments on commit 808ac55

Please sign in to comment.