@zslzxc
2018-03-09T03:33:07.000000Z
字数 1818
阅读 914
docker
mysql
sudo docker network ls
NETWORK ID NAME DRIVER SCOPE
cbd7bde63282 bridge bridge local
f70d523c2652 dockeropenrestylor_default bridge local
57e0e94ae5fc host host local
d1e4fa5e9aba none null local
7f35dcbe0211 pcsoftdocker_default bridge local
0778e8ee2a73 wordpress_default bridge local
sudo docker network inspect pcsoftdocker_default
[
{
"Name": "pcsoftdocker_default",
"Id": "7f35dcbe0211ef761f60d8a907993695866068e4bf6d8e81733d60dd00d9a709",
"Created": "2018-03-07T16:56:44.620498952+08:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.20.0.0/16",
"Gateway": "172.20.0.1"
}
]
},
"Internal": false,
"Attachable": true,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"2da2d11568499a4795617d8753f7f3200a8fb67392048ae3413d23aa283cf4c0": {
"Name": "pcsoftdocker_pcsoft_1",
"EndpointID": "7f4f7a2570c3308c47f4dabba95b151cfbff76d615495de3488517ba5e611078",
"MacAddress": "02:42:ac:14:00:02",
"IPv4Address": "172.20.0.2/16",
"IPv6Address": ""
},
"eb56aa4c97e924474ba912962ae517ad970d73e0e101756194cca2214b96a9e6": {
"Name": "pcsoftdocker_db_1",
"EndpointID": "e4cd75d3829d48bd8ae7cdc3a4775c9c7c4b8672859e8585245dcaff18cd50c6",
"MacAddress": "02:42:ac:14:00:03",
"IPv4Address": "172.20.0.3/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "default",
"com.docker.compose.project": "pcsoftdocker"
}
}
]
amor@amor-PC:~$ mysql -h 172.20.0.3 -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.21 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>