-
Notifications
You must be signed in to change notification settings - Fork 0
/
Docker.txt
98 lines (56 loc) · 2.04 KB
/
Docker.txt
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
1) sudo yum update
2) sudo yum install docker
3) sudo yum info docker
4) pip3 install --user docker-compose
5) sudo systemctl enable docker.service
6) sudo systemctl start docker.service
7) sudo systemctl status docker.service
8) docker version
9) docker-compose version
10) mkdir static-website-1 && cd static-website-1
11) echo 'Docker Apache static site by nixCraft' > index.html
12) vim Dockerfile
FROM centos:centos7
# Install apache2 with less
RUN yum -y update && \
yum -y install httpd && \
yum clean all
# Sample index.html for test
COPY index.html /var/www/html/index.html
# COPY . /var/www/html/
# Port and set entry point for container
EXPOSE 80
ENTRYPOINT /usr/sbin/httpd -DFOREGROUND
13) sudo docker build -t staticsite01 .
14) sudo docker images
15) sudo docker run -d -p 80:80 --name staticsite01 staticsite01
16) sudo docker ps
17) sudo docker port staticsite01
18) curl 127.0.0.1:80
19) docker help
20) man docker-build
21) sudo docker ps -a
22) sudo docker stop my_container
23) sudo docker rm -f container_id
24) sudo docker rmi -f image_name
25) sudo docker exec -it "container ID" sh or bash
docker exec -it b65182422811 bash
26) docker-compose up -d
27) docker inspect db_name
28) docker tag cv:latest bjnandi/cv:latest
29) docker system prune -a
30) sudo docker builder prune
31) docker save -o test.tar my-cv
docker rm -f containder_id
docker build -t myapp:v1 . --no-cache
docker volume create test
docker volume ls
docker volume rm test
docker volume inspect test
docker compose run web env
docker compose convert
docker container inspect tmptest1
docker run -itd --name st123 -v myvol:/app staticsite01
docker run -d -it --name devtest --mount source=myvol2,target=/app nginx:latest
docker run -d -it --name devtest34 --mount type=bind,source="$(pwd)"/target,target=/app nginx:latest
docker run -d -it --name tmptest1 --mount type=tmpfs,destination=/app nginx:latest