Skip to content

port binding error in docker on windows #1

@titania7777

Description

@titania7777

윈도우에서 도커를 사용할때(hpyer-v로 사용할경우) 가끔 아래와같은 에러가 발생할 수 있습니다.

docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:50070: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

이런경우 강의에 필수인 8888포트만 사용하거나 50070포트를 제외해서 사용해 주시기 바랍니다.

만약 50070포트를 사용하고 싶다면 아래와 같이 시도해 보시기 바랍니다.

  1. hyper-v를 비활성화 하고 재부팅을 합니다.
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
  1. 로컬에서 사용할 50070 포트를 추가해줍니다.
netsh interface ipv4 add excludedportrange protocol=tcp startport=50070 numberofports=1
  1. 다시 hyper-v를 활성화 하고 재부팅을 합니다.
dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

*도커를 윈도우에서 사용할때 가급적이면 hyper-v를 사용하지말고 wsl2를 사용할것을 권장합니다.

when running docker on windows(with hyper-v), you might be occurred this error.

docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:50070: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

in this case you can ignore about 50070 port or use only 8888 port to avoid error.

if you want to use 50070 port on windows then follow the steps are:

  1. Disable Hyper-V and restart the device.
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
  1. Add 50070 port to use in local.
netsh interface ipv4 add excludedportrange protocol=tcp startport=50070 numberofports=1
  1. Enable Hyper-V and restart device.
dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

*i recommend to use the wsl2 when running docker on windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions