Skip to content

Commit 480f213

Browse files
Merge pull request onecompiler#355 from harsh18262/docker
update docker cheatsheet: add container related commands
2 parents 5953417 + 9d7a66a commit 480f213

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

docker.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,49 @@ Kill a running container
3737
docker kill container_name/ container_id
3838
```
3939

40+
## Container
41+
42+
List running containers
43+
44+
```
45+
docker container ls
46+
```
47+
48+
List all containers even stopped once
49+
50+
```
51+
docker container ls -a
52+
```
53+
54+
Start and stop a container
55+
56+
```
57+
docker start container_name
58+
docker stop container_name
59+
```
60+
61+
Create a image from a running container
62+
63+
```
64+
docker container commit container_id image_name
65+
```
66+
67+
Delete all stopped containers
68+
69+
```
70+
docker container prune
71+
```
72+
73+
Get all details related to the container
74+
75+
```
76+
docker inspect container_id
77+
```
78+
79+
80+
4081
## Prune
82+
4183
```sh
4284
docker system prune # prune all docker resources
4385
docker system prune -f # prune all resources with force (without prompt)

0 commit comments

Comments
 (0)