Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Swarm + Windows Server 2022. Can't start connected to overlay network container with published ports (host mode) #42811

Closed
VuiDJi opened this issue Sep 2, 2021 · 7 comments · Fixed by #43634

Comments

@VuiDJi
Copy link

VuiDJi commented Sep 2, 2021

Docker on Windows Server 2022 crashes when trying to start connected to overlay network container with published ports (host mode).
For the same reason can't deploy any stack with published ports because docker always creates new overlay network for stack.

Steps to reproduce the issue:

  1. Install Windows Server 2022 and all updates, set static IP (192.168.77.104)
  2. Install Docker, I mean Mirantis Container Runtime (ex. Docker Enterprise Engine)
  3. docker swarm init --advertise-addr 192.168.77.104 --listen-addr 192.168.77.104
  4. docker run -d --name test1 -p 80:80 mcr.microsoft.com/dotnet/samples:aspnetapp
    IT WORKS!
  5. docker rm test1 -f
  6. docker network create --driver overlay --attachable test-network
  7. docker run -d --name test2 --publish published=80,target=80,mode=host --network test-network mcr.microsoft.com/dotnet/samples:aspnetapp
    GET AN ERROR: docker: Error response from daemon: failed to create endpoint test2 on network test-network: Bind for 0.0.0.0:80 failed: port is already allocated.
  8. docker rm test2
  9. Trying use even different ports for host and container:
    docker run -d --name test3 --publish published=8080,target=80,mode=host --network test-network mcr.microsoft.com/dotnet/samples:aspnetapp
    GET AN ERROR: docker: Error response from daemon: failed to create endpoint test3 on network test-network: Bind for 0.0.0.0:8080 failed: port is already allocated.

Describe the results you received:
Can't use port publishing with host mode + overlay network.

Describe the results you expected:
Port publishing with host mode and overlay network should work

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client: Mirantis Container Runtime
 Version:           20.10.6
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        b3766ff
 Built:             06/29/2021 17:14:16
 OS/Arch:           windows/amd64
 Context:           default
 Experimental:      true

Server: Mirantis Container Runtime
 Engine:
  Version:          20.10.6
  API version:      1.41 (minimum version 1.24)
  Go version:       go1.13.15
  Git commit:       a3dc69e6b9
  Built:            06/29/2021 17:12:49
  OS/Arch:          windows/amd64
  Experimental:     false

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker Application (Docker Inc., v0.8.0)
  cluster: Manage Mirantis Container Cloud clusters (Mirantis Inc., v1.9.0)
  registry: Manage Docker registries (Docker Inc., 0.1.0)

Server:
 Containers: 1
  Running: 0
  Paused: 0
  Stopped: 1
 Images: 22
 Server Version: 20.10.6
 Storage Driver: windowsfilter
  Windows:
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
 Swarm: active
  NodeID: aizatb4rxdp4p24hhojs7mtny
  Is Manager: true
  ClusterID: ycgq3kqc15lxqfgkpaarqgudj
  Managers: 1
  Nodes: 1
  Default Address Pool: 10.0.0.0/8
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: 192.168.77.104
  Manager Addresses:
   192.168.77.104:2377
 Default Isolation: process
 Kernel Version: 10.0 20348 (20348.1.amd64fre.fe_release.210507-1500)
 Operating System: Windows Server 2022 Standard Evaluation Version 2009 (OS Build 20348.202)
 OSType: windows
 Architecture: x86_64
 CPUs: 28
 Total Memory: 32GiB
 Name: SRV-WDA1
 ID: HUZK:R3D3:QTHU:O5F3:VTWK:LTHO:QGB5:5FS7:BYE5:HBYJ:ODPV:J5TL
 Docker Root Dir: C:\ProgramData\docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
@VuiDJi
Copy link
Author

VuiDJi commented Oct 22, 2021

Any news?

@VuiDJi
Copy link
Author

VuiDJi commented Mar 15, 2022

Any news?

1 similar comment
@VuiDJi
Copy link
Author

VuiDJi commented Apr 22, 2022

Any news?

@VuiDJi
Copy link
Author

VuiDJi commented May 26, 2022

@thaJeztah
I made a build of the latest version from git. Unfortunately, the error is still present, although a different message is now displayed:

docker network create --driver overlay --attachable test-network2
thxttirblx4kf2gutbsexk8lu

docker run -d --name test3 --publish published=30080,target=80,mode=host --network test-network2 mcr.microsoft.com/dotnet/samples:aspnetapp
24978d0588e5b5c331b9915ac12375c670a6549f8f600cdc548683d1e5232df1
docker: Error response from daemon: attaching to network failed, make sure your network options are correct and check manager logs: context deadline exceeded.

@olljanat
Copy link
Contributor

olljanat commented Jun 7, 2022

@VuiDJi based on release notes this have been fixed on latest version https://github.com/moby/moby/releases/tag/v20.10.17 which you can find from https://download.docker.com/win/static/stable/x86_64/

However pls try that on server which haven't had other Docker versions installed earlier.

@VuiDJi
Copy link
Author

VuiDJi commented Jul 19, 2022

@olljanat I've tried using https://github.com/moby/moby/releases/tag/v20.10.17 release, but unfortunately it still doesn't work:
PS C:\Windows\system32> docker run -it --rm --publish published=30080,target=80,mode=host --network test-10-17 mcr.microsoft.com/dotnet/samples:aspnetapp
docker: Error response from daemon: failed to create endpoint intelligent_faraday on network test-10-17: Bind for 0.0.0.0:30080 failed: port is already allocated.

@olljanat
Copy link
Contributor

@VuiDJi after reading that pull request more carefully I noticed that it also needs update to Windows itself which is not yet publicly available. Look #43634 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants