目次
参考
ネットワーク一覧表示
Docker起動後以下のコマンドを実行
PS D:\> docker network ls
NETWORK ID NAME DRIVER SCOPE
ea1710130e72 bridge bridge local
87419fea1f6e dockerbuild_laravel_network bridge local
c7cc7a067126 host host local
afd02037053f none null local
デフォルトのネットワーク名
Dockerが初期状態で作成するネットワークには、以下の3つがあります:
bridge
:- Dockerコンテナがデフォルトで接続する仮想ネットワーク。
- 通常、単一ホスト内のコンテナ間通信に使用されます。
host
:- コンテナがホストのネットワークスタックを共有するネットワーク。
none
:- ネットワークが無効化された状態(通信機能なし)。
docker ネットワーク名 dockerbuild_laravel_network
dockerネットワーク名は、「Conteainersの名前+ネットワーク名」となります。
ネットワーク名
docker-compose.yml
networks:
laravel_network:
Conteainersの名前
ネットワーク詳細
dockerbuild_laravel_network
PS D:\> docker network inspect dockerbuild_laravel_network
[
{
"Name": "dockerbuild_laravel_network",
"Id": "87419fea1f6e7c4c47851576baf26f44b89d3c6dc03e5bd16f1eb936d268213b",
"Created": "2025-01-05T01:21:57.260143221Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.18.0.0/16",
"Gateway": "172.18.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"268a56615883a4250e2b5031809457f5a4f779e6c803caea049740dc93aac696": {
"Name": "laravel-nginx",
"EndpointID": "a1ccc20e81f372cf045829d2be8c98da6af1d5c4dd02c65864c4c6a169a38128",
"MacAddress": "02:42:ac:12:00:05",
"IPv4Address": "172.18.0.5/16",
"IPv6Address": ""
},
"537430da4f98a8cbbc4bcdbe599c0a410a0f8ff5ac83a11515606f88afb37594": {
"Name": "laravel-postgres",
"EndpointID": "7527d67dd5d8f01f9a95198ad81aabb22807ac25a05d053b84e2deb10869236e",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
},
"f54a5de7d310a5fa2e2eb6cdfb93b7b2cee740a5f2ed5b66ab36634d3c38b115": {
"Name": "laravel-app",
"EndpointID": "2326e34ba844fd1dafb21dbdeea8750b6918add933285248a54b4cbd5d12f01f",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "laravel_network",
"com.docker.compose.project": "dockerbuild",
"com.docker.compose.version": "2.30.3"
}
}
]
bridge
PS D:\> docker network inspect bridge
[
{
"Name": "bridge",
"Id": "ea1710130e728166be7d10aedc7ce0a5cd1f55c876733111b95d5706e650e86e",
"Created": "2025-01-05T07:49:23.333136928Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.17.0.0/16",
"Gateway": "172.17.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {},
"Options": {
"com.docker.network.bridge.default_bridge": "true",
"com.docker.network.bridge.enable_icc": "true",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
"com.docker.network.bridge.name": "docker0",
"com.docker.network.driver.mtu": "1500"
},
"Labels": {}
}
]
PS D:\>