>

버그 보고서 정보

설명

Windows 10의 컨테이너 내에서 docker-compose 서비스를 ping 할 수 없습니다. 해당 서비스의 IP 주소를 핑 (Ping)하면 작동합니다.

문제를 재현하는 단계 :

1 다음 내용으로 docker-compose-quick-servers.yml을 만듭니다

version: '3.4'
services:
    server1:
        image: mcr.microsoft.com/windows/nanoserver
        container_name: Server_1
        entrypoint: ping -t localhost
      server2:
        image: mcr.microsoft.com/windows/nanoserver
        container_name: Server_2
        entrypoint: ping -t localhost
    networks:
      default:
        external:
          name: nat

2 도커 컨테이너를 실행합니다 : docker-compose -f. \ docker-compose-quick-servers.yml up -d

3 다른 도커 작성 서비스 Ping : docker exec Server_1 ping server2

받은 결과 설명 : 핑이 실패합니다. 두 번째 서비스 IP 주소와 동일한 작업이 정상적으로 작동합니다.

예상 결과 설명 : 정의 된 이름을 사용하여 서비스를 핑할 수 있어야합니다.

중요하다고 생각되는 추가 정보 (예 : 문제는 가끔 발생 함) : Windows Server 2016의 제품 환경에서 제대로 작동합니다.

docker version 의 출력 :

Client: Docker Engine - Community
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        6247962
 Built:             Sun Feb 10 04:12:31 2019
 OS/Arch:           windows/amd64
 Experimental:      false
Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.24)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:28:48 2019
  OS/Arch:          windows/amd64
  Experimental:     false

docker info 의 출력 :

Containers: 2
 Running: 2
 Paused: 0
 Stopped: 0
Images: 9
Server Version: 18.09.2
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: ics l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd gelf json-file local logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 17134 (17134.1.amd64fre.rs4_release.180410-1804)
Operating System: Windows 10 Enterprise Version 1803 (OS Build 17134.706)
OSType: windows
Architecture: x86_64
CPUs: 8
Total Memory: 15.93GiB
Name: H198818
ID: HOKO:5CAS:SIQ2:SCLD:3TB7:A6GG:EH5X:763G:CBV5:UQMJ:BGSO:PF2Y
Docker Root Dir: E:\ProgramData\Docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: -1
 Goroutines: 36
 System Time: 2019-04-18T15:33:25.7898496-04:00
 EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

도 커가 두 컨테이너를 모두 검사 컨테이너 1

[
    {
        "Id": "a187264b5df41392b85a6b0d465af14e0dae699893aa2bd7d325d3638ca37280",
        "Created": "2019-07-19T15:41:58.0571535Z",
        "Path": "ping",
        "Args": [
            "-t",
            "localhost"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 1180,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2019-07-22T13:10:28.0169558Z",
            "FinishedAt": "2019-07-20T03:42:53.7800119-04:00"
        },
        "Image": "sha256:cf751d69394af7dc72bd2a251b5f206c623d58ad3c227b4eb38b7f78695fd6c6",
        "ResolvConfPath": "",
        "HostnamePath": "",
        "HostsPath": "",
        "LogPath": "C:\\ProgramData\\Docker\\containers\\a187264b5df41392b85a6b0d465af14e0dae699893aa2bd7d325d3638ca37280\\a187264b5df41392b85a6b0d465af14e0dae699893aa2bd7d325d3638ca37280-json.log",
        "Name": "/Server_2",
        "RestartCount": 0,
        "Driver": "windowsfilter",
        "Platform": "windows",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "nat",
            "PortBindings": {},
            "RestartPolicy": {
                "Name": "",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": [],
            "CapAdd": null,
            "CapDrop": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 0,
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "hyperv",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": null,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": null,
            "ReadonlyPaths": null
        },
        "GraphDriver": {
            "Data": {
                "dir": "C:\\ProgramData\\Docker\\windowsfilter\\a187264b5df41392b85a6b0d465af14e0dae699893aa2bd7d325d3638ca37280"
            },
            "Name": "windowsfilter"
        },
        "Mounts": [],
        "Config": {
            "Hostname": "a187264b5df4",
            "Domainname": "",
            "User": "ContainerUser",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": null,
            "Cmd": null,
            "Image": "mcr.microsoft.com/windows/nanoserver:1809",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [
                "ping",
                "-t",
                "localhost"
            ],
            "OnBuild": null,
            "Labels": {
                "com.docker.compose.config-hash": "be02643ae0be24af8c209ead0232c7c323bce17485989dc12dfc691d5d5ec1b6",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "temp",
                "com.docker.compose.service": "server2",
                "com.docker.compose.version": "1.23.2"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "a187264b5df41392b85a6b0d465af14e0dae699893aa2bd7d325d3638ca37280",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "a187264b5df41392b85a6b0d465af14e0dae699893aa2bd7d325d3638ca37280",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "nat": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "server2",
                        "a187264b5df4"
                    ],
                    "NetworkID": "a8c298597e4971959a217132aaf2521cdc5d0b3ce887580ad4239dce75f7e697",
                    "EndpointID": "edbb8a518b5be347f2c600864838bc850d8951a1e09a78b97f0fd0d67bf7a5d1",
                    "Gateway": "172.30.48.1",
                    "IPAddress": "172.30.57.127",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "00:15:5d:53:a2:da",
                    "DriverOpts": null
                }
            }
        }
    }
]

컨테이너 2

[
    {
        "Id": "dca6e1b6e86c9e888f0c817c8f5677f6e9d1513ee67715b77f5ca134811ee2c0",
        "Created": "2019-07-19T15:41:58.0571535Z",
        "Path": "ping",
        "Args": [
            "-t",
            "localhost"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 1172,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2019-07-22T13:10:28.0179564Z",
            "FinishedAt": "2019-07-20T03:42:53.7730133-04:00"
        },
        "Image": "sha256:cf751d69394af7dc72bd2a251b5f206c623d58ad3c227b4eb38b7f78695fd6c6",
        "ResolvConfPath": "",
        "HostnamePath": "",
        "HostsPath": "",
        "LogPath": "C:\\ProgramData\\Docker\\containers\\dca6e1b6e86c9e888f0c817c8f5677f6e9d1513ee67715b77f5ca134811ee2c0\\dca6e1b6e86c9e888f0c817c8f5677f6e9d1513ee67715b77f5ca134811ee2c0-json.log",
        "Name": "/Server_1",
        "RestartCount": 0,
        "Driver": "windowsfilter",
        "Platform": "windows",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "nat",
            "PortBindings": {},
            "RestartPolicy": {
                "Name": "",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": [],
            "CapAdd": null,
            "CapDrop": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 0,
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "hyperv",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": null,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": null,
            "ReadonlyPaths": null
        },
        "GraphDriver": {
            "Data": {
                "dir": "C:\\ProgramData\\Docker\\windowsfilter\\dca6e1b6e86c9e888f0c817c8f5677f6e9d1513ee67715b77f5ca134811ee2c0"
            },
            "Name": "windowsfilter"
        },
        "Mounts": [],
        "Config": {
            "Hostname": "dca6e1b6e86c",
            "Domainname": "",
            "User": "ContainerUser",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": null,
            "Cmd": null,
            "Image": "mcr.microsoft.com/windows/nanoserver:1809",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [
                "ping",
                "-t",
                "localhost"
            ],
            "OnBuild": null,
            "Labels": {
                "com.docker.compose.config-hash": "39e91b8015a79dda2357d7e1af47455981a66b7d56d23b397d649f096e1b93f1",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "temp",
                "com.docker.compose.service": "server1",
                "com.docker.compose.version": "1.23.2"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "dca6e1b6e86c9e888f0c817c8f5677f6e9d1513ee67715b77f5ca134811ee2c0",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "dca6e1b6e86c9e888f0c817c8f5677f6e9d1513ee67715b77f5ca134811ee2c0",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "nat": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "server1",
                        "dca6e1b6e86c"
                    ],
                    "NetworkID": "a8c298597e4971959a217132aaf2521cdc5d0b3ce887580ad4239dce75f7e697",
                    "EndpointID": "8825f5c168aeb39a022de1ab4cc0f0f5bdc5a1938d490a40d476182d96904791",
                    "Gateway": "172.30.48.1",
                    "IPAddress": "172.30.56.75",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "00:15:5d:53:ad:eb",
                    "DriverOpts": null
                }
            }
        }
    }
]



  • 답변 # 1

    Windows Server에는 Docker CE를 권장하지 않습니다. Docker EE Basic을 사용하면 Windows Server에서 무료로 사용할 수 있습니다.

    업데이트 : 일반적으로 구성이 정상적으로 보입니다 ... 별칭이 설정되었지만 핑 출력에서 ​​핑의 문제는 아니지만 dns 해상도입니다. 두 번째 컨테이너는 도커 내부 DNS를 사용하는 대신 일부 외부 DNS를 사용하여 server1을 해결합니다.

    Windows 컨테이너의 docker dns 해상도와 유사한 버그 보고서가 있습니다 : https://github.com/docker/for-win/issues/1976

    이것이 당신의 경우 일 수 있습니다

    .

    임시 솔루션으로 127.0.0.11 에서 컨테이너에 dns resolver를 기본 docker dns로 설정하는 것이 좋습니다.  (https://docs.docker.com/v17.09/engine/userguide/networking/configure-dns/)

    업데이트 2 : Win1809에서 재현했으며 다음과 같이 작동합니다.

    PS E:\workspace\docker-test> docker-compose up -d
    Pulling server1 (mcr.microsoft.com/windows/nanoserver:1809)...
    1809: Pulling from windows/nanoserver
    58fd16eaae0b: Pull complete
    Pulling server2 (mcr.microsoft.com/windows/nanoserver:1809)...
    1809: Pulling from windows/nanoserver
    Creating Server_1 ... done
    Creating Server_2 ... done
    PS E:\workspace\docker-test> docker ps
    CONTAINER ID        IMAGE                                       COMMAND               CREATED             STATUS              PORTS               NAMES
    0628c2fd7106        mcr.microsoft.com/windows/nanoserver:1809   "ping -t localhost"   12 seconds ago      Up 6 seconds                            Server_1
    8e52138080f2        mcr.microsoft.com/windows/nanoserver:1809   "ping -t localhost"   12 seconds ago      Up 6 seconds                            Server_2
    PS E:\workspace\docker-test> docker exec Server_2 ping Server_1
    Pinging Server_1 [172.27.195.21] with 32 bytes of data:
    Reply from 172.27.195.21: bytes=32 time<1ms TTL=128
    Reply from 172.27.195.21: bytes=32 time=5ms TTL=128
    PS E:\workspace\docker-test> docker exec Server_1 ping Server_2
    Pinging Server_2 [172.27.193.166] with 32 bytes of data:
    Reply from 172.27.193.166: bytes=32 time<1ms TTL=128
    Reply from 172.27.193.166: bytes=32 time=1ms TTL=128
    PS E:\workspace\docker-test> docker exec Server_2 ping server1
    Pinging server1 [172.27.195.21] with 32 bytes of data:
    Reply from 172.27.195.21: bytes=32 time=1ms TTL=128
    Reply from 172.27.195.21: bytes=32 time=2ms TTL=128
    PS E:\workspace\docker-test> docker exec Server_1 ping server2
    Pinging server2 [172.27.193.166] with 32 bytes of data:
    Reply from 172.27.193.166: bytes=32 time<1ms TTL=128
    Reply from 172.27.193.166: bytes=32 time=4ms TTL=128
    
    

관련 자료

  • 이전 reporting services - SSIS가 SSRS에서 PDF를 저장하면 PDF가 손상됩니다
  • 다음 Raspberry Pi에서 Python scikit-learn을 어떻게 실행할 수 있습니까?