0% found this document useful (0 votes)
39 views

Docker Commands

This document provides a list of 76 commands for working with Docker, including running containerized applications, building and pushing images to repositories, networking containers, and using Docker Compose. The commands cover starting, stopping, and managing containers; building, tagging, and pushing images; inspecting systems resources and images; and networking containers together.

Uploaded by

Yaswanth Bobbu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Docker Commands

This document provides a list of 76 commands for working with Docker, including running containerized applications, building and pushing images to repositories, networking containers, and using Docker Compose. The commands cover starting, stopping, and managing containers; building, tagging, and pushing images; inspecting systems resources and images; and networking containers together.

Uploaded by

Yaswanth Bobbu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Docker

Github Repo: https://github.com/in28minutes/devops-master-class

Docker:
Wsl –update –rollback (if needed)
settings > windows update > advanced options > receive updates for Microsoft products

1. docker --version
2. docker run -p 5000:5000 in28min/hello-world-python:0.0.1.RELEASE
3. docker run -p 5000:5000 in28min/hello-world-java:0.0.1.RELEASE
4. docker run -p 5000:5000 in28min/hello-world-nodejs:0.0.1.RELEASE
5. docker run -d -p 5000:5000 in28min/hello-world-nodejs:0.0.1.RELEASE
6. docker run -d -p 5001:5000 in28min/hello-world-python:0.0.1.RELEASE
7. docker logs
04e52ff9270f5810eefe1f77222852dc1461c22440d4ecd6228b5c38f09d838e
8. docker logs c2ba
9. docker images
10. docker container ls
11. docker container ls -a
12. docker container stop f708b7ee1a8b
13. docker run -d -p 5001:8080 in28min/hello-world-rest-
api:0.0.1.RELEASE
14. docker pull mysql
15. docker search mysql
16. docker image history in28min/hello-world-java:0.0.1.RELEASE
17. docker image history 100229ba687e
18. docker image inspect 100229ba687e
19. docker image remove mysql
20. docker image remove in28min/hello-world-java:0.0.1.RELEASE
21. docker container rm 3e657ae9bd16
22. docker container ls -a
23. docker container pause 832
24. docker container unpause 832
25. docker container stop 832
26. docker container inspect ff521fa58db3
27. docker container prune

28. docker system


29. docker system df
30. docker system info
31. docker system prune -a
32. docker top 9009722eac4d
33. docker stats 9009722eac4d
34. docker container run -p 5000:5000 -d -m 512m in28min/hello-world-
java:0.0.1.RELEASE
35. docker container run -p 5000:5000 -d -m 512m --cpu-quota=50000
in28min/hello-world-java:0.0.1.RELEASE

Page 1 of 3
36. docker system events

37. docker container stats


4faca1ea914e3e4587d1d790948ec6cb8fa34f26e900c12632fd64d4722fd59a
38. docker stats
42f170966ce613d2a16d7404495af7b3295e01aeb9142e1fa1762bbdc581f502

39. cd /in28Minutes/git/devops-master-class/projects/hello-world/hello-
world-python
40. docker build -t in28min/hello-world-python:0.0.2.RELEASE .
41. docker run -p 5000:5000 -d in28min/hello-world-python:0.0.2.RELEASE
42. docker history e66dc383f7a0
43. docker push in28min/hello-world-python:0.0.2.RELEASE

44. cd ../hello-world-nodejs/
45. docker build -t in28min/hello-world-nodejs:0.0.2.RELEASE .
46. docker container run -d -p 5000:5000 in28min/hello-world-
nodejs:0.0.2.RELEASE
47. docker push in28min/hello-world-nodejs:0.0.2.RELEASE

48. cd ../hello-world-java/
49. docker build -t in28min/hello-world-java:0.0.2.RELEASE .
50. docker run -d -p 5000:5000 in28min/hello-world-java:0.0.2.RELEASE
51. docker push in28min/hello-world-java:0.0.2.RELEASE

52. docker run -d -p 5001:5000 in28min/hello-world-nodejs:0.0.3.RELEASE


ping google.com
53. docker run -d -p 8000:8000 --name=currency-exchange
in28min/currency-exchange:0.0.1-RELEASE
54. docker run -d -p 8100:8100 --name=currency-conversion
in28min/currency-conversion:0.0.1-RELEASE
55. docker network ls
56. docker network inspect bridge
57. docker run -d -p 8100:8100 --env
CURRENCY_EXCHANGE_SERVICE_HOST=http://currency-exchange --
name=currency-conversion --link currency-exchange in28min/currency-
conversion:0.0.1-RELEASE

58. docker network create currency-network


59. docker container stop currency-exchange
60. docker container stop currency-conversion
61. docker run -d -p 8000:8000 --name=currency-exchange --
network=currency-network in28min/currency-exchange:0.0.1-RELEASE
62. docker run -d -p 8100:8100 --env
CURRENCY_EXCHANGE_SERVICE_HOST=http://currency-exchange --
name=currency-conversion --network=currency-network
in28min/currency-conversion:0.0.1-RELEASE

63. docker-compose --version


64. cd ../../microservices/
65. docker-compose up
66. docker-compose up -d
67. docker container ls
68. docker network ls

Page 2 of 3
69. docker network inspect microservices_currency-compose-network
70. docker-compose down
71. docker container ls -a
72. docker system prune -a
73. docker-compose config
74. docker-compose images
75. docker-compose ps
76. docker-compose top

1. docker build -t in28min/hello-world-java:0.0.1.RELEASE .


2. docker push in28min/hello-world-java:0.0.1.RELEASE
3. docker build -t in28min/hello-world-python:0.0.1.RELEASE .
4. docker push in28min/hello-world-python:0.0.1.RELEASE
5. docker build -t in28min/hello-world-nodejs:0.0.1.RELEASE .
6. docker push in28min/hello-world-nodejs:0.0.1.RELEASE

Page 3 of 3

You might also like