Getting the following exception any time I try to run the dotnet sample app from docker hub: Unhandled exception. System.IO.IOException: Failed to bind to address http://[::]:80: address already in use. ---> Microsoft.AspNetCore.Connections.AddressInUseException: Address in use
- Dominant language
- Dockerfile
- Stars
- 4.9k
- Forks
- 2k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 26
Description
### Describe the Bug
Any time I try to run the docker sample app from the Microsoft Docker Hub Documentation here:
https://hub.docker.com/_/microsoft-dotnet-samples/
for the command:
`docker run -it --rm -p 8800:80 --name aspnetcore_sample mcr.microsoft.com/dotnet/samples:aspnetapp`
I get the following error:
Unhandled exception. System.IO.IOException: Failed to bind to address http://[::]:80: address already in use.
---> Microsoft.AspNetCore.Connections.AddressInUseException: Address in use
---> System.Net.Sockets.SocketException (98): Address in use
at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError, Boolean , String )
at System.Net.Sockets.Socket.DoBind(EndPoint, SocketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint)
at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportOptions.CreateDefaultBoundListenSocket(EndPoint)
at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.Bind()
--- End of inner exception stack trace ---
### Steps to Reproduce
Simply go to to this link:
https://hub.docker.com/_/microsoft-dotnet-samples/
and pick the **Container sample: Run a web application** sample and try to run the following command as per the instructions there:
`docker run -it --rm -p 8000:80 --name aspnetcore_sample mcr.microsoft.com/dotnet/samples:aspnetapp`
and you should be able to receive the same excpetion
### Output of `docker version`
Client:
Cloud integration: v1.0.31
Version: 20.10.24
API version: 1.41
Go version: go1.19.7
Git commit: 297e128
Built: Tue Apr 4 18:28:08 2023
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Desktop 4.18.0 (104112)
Engine:
Version: 20.10.24
API version: 1.41 (minimum version 1.12)
Go version: go1.19.7
Git commit: 5d6db84
Built: Tue Apr 4 18:18:42 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.18
GitCommit: 2456e983eb9e37e47538f59ea18f2043c9a73640
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
### Output of `docker info`
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc., v0.10.4)
compose: Docker Compose (Docker Inc., v2.17.2)
dev: Docker Dev Environments (Docker Inc., v0.1.0)
extension: Manages Docker extensions (Docker Inc., v0.2.19)
init: Creates Docker-related starter files for your project (Docker Inc., v0.1.0-beta.2)
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
scan: Docker Scan (Docker Inc., v0.25.0)
scout: Command line tool for Docker Scout (Docker Inc., v0.9.0)
Server:
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 22
Server Version: 20.10.24
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 2456e983eb9e37e47538f59ea18f2043c9a73640
runc version: v1.1.4-0-g5fd4c4d
init version: de40ad0
Security Options:
seccomp
Profile: default
cgroupns
Kernel Version: 5.15.90.1-microsoft-standard-WSL2
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.53GiB
Name: docker-desktop
ID: JB3P:WTLF:JOAB:5FXL:DORD:P6GC:SVJW:22SB:MVNH:5DBU:TNLY:W3I3
Docker Root Dir: /var/lib/docker
Debug Mode: false
HTTP Proxy: http.docker.internal:3128
HTTPS Proxy: http.docker.internal:3128
No Proxy: hubproxy.docker.internal
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
hubproxy.docker.internal:5555
127.0.0.0/8
Live Restore Enabled: false
I'd appreciate any help with this. Thanks
Contributor guide
Assessment
This issue has not been assessed yet.