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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
hekai@00bafcjc-dUrwEMo9N5:/opt/workspace/msdemt/docker-collection/docker-compose/mariadb$ cat docker-compose.yml
version: '3.1'
services:
db:
image: mariadb:5.5.60
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_ROOT_HOST: "%"
TZ: Asia/Shanghai
ports:
- 3306:3306
volumes:
- .data:/var/lib/mysql
- .conf:/etc/mysql/conf.d
networks:
mynet1:
ipv4_address: 172.15.0.2
adminer:
image: adminer
restart: always
environment:
TZ: Asia/Shanghai
ports:
- 18080:8080
networks:
mynet1:
ipv4_address: 172.15.0.3
networks:
mynet1:
ipam:
config:
- subnet: 172.15.0.0/16
hekai@00bafcjc-dUrwEMo9N5:/opt/workspace/msdemt/docker-collection/docker-compose/mariadb$ docker network ls
NETWORK ID NAME DRIVER SCOPE
7350be8b3ad2 bridge bridge local
0d7795b17742 docker-centos7-slurm-cluster_default bridge local
666586e51a5b host host local
97ca9cb8d2ea none null local
hekai@00bafcjc-dUrwEMo9N5:/opt/workspace/msdemt/docker-collection/docker-compose/mariadb$ docker compose up -d
[+] Building 0.0s (0/0)
[+] Running 3/3
✔ Network mariadb_mynet1 Created 0.1s
✔ Container mariadb-adminer-1 Started 1.7s
✔ Container mariadb-db-1 Started 0.8s
hekai@00bafcjc-dUrwEMo9N5:/opt/workspace/msdemt/docker-collection/docker-compose/mariadb$ docker network ls
NETWORK ID NAME DRIVER SCOPE
7350be8b3ad2 bridge bridge local
0d7795b17742 docker-centos7-slurm-cluster_default bridge local
666586e51a5b host host local
40ffa94e1ab4 mariadb_mynet1 bridge local
97ca9cb8d2ea none null local
hekai@00bafcjc-dUrwEMo9N5:/opt/workspace/msdemt/docker-collection/docker-compose/mariadb$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
49caff9a1d15 mariadb:5.5.60 "docker-entrypoint.s…" About a minute ago Up About a minute 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp mariadb-db-1
127e6317a80a adminer "entrypoint.sh php -…" About a minute ago Up About a minute 0.0.0.0:18080->8080/tcp, :::18080->8080/tcp mariadb-adminer-1
64a701a17667 hekai/centos7.9-slurm22 "/tini -- /usr/local…" 9 hours ago Up 9 hours 22/tcp, 3306/tcp, 6817-6820/tcp docker-centos7-slurm-cluster-slurm-compute-1-1
e9762ead7456 hekai/centos7.9-slurm22 "/tini -- /usr/local…" 9 hours ago Up 9 hours 22/tcp, 3306/tcp, 6817-6820/tcp docker-centos7-slurm-cluster-slurm-compute-2-1
1fc423ffcf00 hekai/centos7.9-slurm22 "/tini -- /usr/local…" 9 hours ago Up 9 hours 22/tcp, 3306/tcp, 0.0.0.0:389->389/tcp, :::389->389/tcp, 6817-6819/tcp, 0.0.0.0:6820->6820/tcp, :::6820->6820/tcp docker-centos7-slurm-cluster-slurm-master-1
hekai@00bafcjc-dUrwEMo9N5:/opt/workspace/msdemt/docker-collection/docker-compose/mariadb$ docker inspect 49caff9a1d15 | grep IPAddress
"SecondaryIPAddresses": null,
"IPAddress": "",
"IPAddress": "172.15.0.2",
hekai@00bafcjc-dUrwEMo9N5:/opt/workspace/msdemt/docker-collection/docker-compose/mariadb$ docker inspect 127e6317a80a | grep IPAddress
"SecondaryIPAddresses": null,
"IPAddress": "",
"IPAddress": "172.15.0.3",
hekai@00bafcjc-dUrwEMo9N5:/opt/workspace/msdemt/docker-collection/docker-compose/mariadb$ docker compose down
[+] Running 3/3
✔ Container mariadb-adminer-1 Removed 0.4s
✔ Container mariadb-db-1 Removed 5.3s
✔ Network mariadb_mynet1 Removed 0.2s
hekai@00bafcjc-dUrwEMo9N5:/opt/workspace/msdemt/docker-collection/docker-compose/mariadb$ docker network ls
NETWORK ID NAME DRIVER SCOPE
7350be8b3ad2 bridge bridge local
0d7795b17742 docker-centos7-slurm-cluster_default bridge local
666586e51a5b host host local
97ca9cb8d2ea none null local
hekai@00bafcjc-dUrwEMo9N5:/opt/workspace/msdemt/docker-collection/docker-compose/mariadb$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
66a097a109ef mariadb:5.5.60 "docker-entrypoint.s…" 8 seconds ago Up 5 seconds 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp mariadb-db-1
b9188a6e2cf6 adminer "entrypoint.sh php -…" 8 seconds ago Up 6 seconds 0.0.0.0:18080->8080/tcp, :::18080->8080/tcp mariadb-adminer-1
64a701a17667 hekai/centos7.9-slurm22 "/tini -- /usr/local…" 9 hours ago Up 9 hours 22/tcp, 3306/tcp, 6817-6820/tcp docker-centos7-slurm-cluster-slurm-compute-1-1
e9762ead7456 hekai/centos7.9-slurm22 "/tini -- /usr/local…" 9 hours ago Up 9 hours 22/tcp, 3306/tcp, 6817-6820/tcp docker-centos7-slurm-cluster-slurm-compute-2-1
1fc423ffcf00 hekai/centos7.9-slurm22 "/tini -- /usr/local…" 9 hours ago Up 9 hours 22/tcp, 3306/tcp, 0.0.0.0:389->389/tcp, :::389->389/tcp, 6817-6819/tcp, 0.0.0.0:6820->6820/tcp, :::6820->6820/tcp docker-centos7-slurm-cluster-slurm-master-1
hekai@00bafcjc-dUrwEMo9N5:/opt/workspace/msdemt/docker-collection/docker-compose/mariadb$ docker inspect 1fc423ffcf00 | grep IPAddress
"SecondaryIPAddresses": null,
"IPAddress": "",
"IPAddress": "172.19.0.2",
hekai@00bafcjc-dUrwEMo9N5:/opt/workspace/msdemt/docker-collection/docker-compose/mariadb$ docker exec -ti 66a097a109ef bash
root@66a097a109ef:/# ping 172.19.0.2
PING 172.19.0.2 (172.19.0.2) 56(84) bytes of data.
^C
--- 172.19.0.2 ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 6129ms
root@66a097a109ef:/# ping www.baidu.com
PING www.a.shifen.com (220.181.38.149) 56(84) bytes of data.
64 bytes from 220.181.38.149: icmp_seq=1 ttl=48 time=10.6 ms
64 bytes from 220.181.38.149: icmp_seq=2 ttl=48 time=10.6 ms
^C
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 10.639/10.646/10.654/0.103 ms
root@66a097a109ef:/# exit
exit
hekai@00bafcjc-dUrwEMo9N5:/opt/workspace/msdemt/docker-collection/docker-compose/mariadb$
|