-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands
65 lines (43 loc) · 1.46 KB
/
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
intro:
docker ps -> list all runnig containers
docker ps -a -> list all containers (all)
docker images -> list all images
docker pull -> pull an image
docker run -> start a container
---------------------------------
Containers Commands:
docker ps
docker start/stop/restart CONTAINER_ID/CONTAINER_NAME
docker rm -f CONTAINER_ID/CONTAINER_NAME
docker exec -it some-mongo /bin/bash
docker logs -f CONTAINER_ID/CONTAINER_NAME
docker run -d --name CONTAINER_NAME -p HOST_LISTEN_IP:HOST_PORT:CONTAINER_PORT -v VOLUME_NAME:DIRECTORY_INSIDE_CONTAINER -v DIRECTORY_ON_HOST:DIRECTORY_INSIDE_CONTAINER IMAGE_NAME:TAG
---------------------------------
Images:
docker image pull IMAGE_NAME:TAG
docker image push IMAGE_NAME:TAG
docker images
docker rmi IMAGE_NAME:TAG
docker build -t IMAGE_NAME:IMAGE_TAG .
Tag: ->it's image version
f-1-2
f-3-4
latest-> nginx:19.2.4 -, Default tag.
docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
---------------------------------
Volume:
docker volume ls
docker volume create VOLUME_NAME
docker volume inspect VOLUME_NAME
---------------------------------
Networking:
docker network ls
docker network create --driver bridge NETWORKNAME
docker network inspect NETWORKNAME
docker run -d --name CONTAINER_NAME --network NETWORKNAME IMAGE_NAME:TAG
TODO:
image tagging
docker network
docker compose
container orcherstration intro
dockerfile cheatsheet: https://kapeli.com/cheat_sheets/Dockerfile.docset/Contents/Resources/Documents/index