Docker img ipv6 problem

On my host the ipv6 is disabled. I had to start a docker image, which would like to use ipv6.

This conflict provides this error message:

Error response from daemon: driver failed programming external connectivity on endpoint CONTAINER_NAME(HASH): Error starting userland proxy: listen tcp6 [::]:PORT_NUMBER: socket: address family not supported by protocol

The resolution, to define the IP address in port mapping (for DHCP, with global definition):

docker run -p 0.0.0.0:HOST_PORT:CONTAINER_PORT

Or in docker-compose.yml like this:

version: "3.9"
services:
  SERVICE_NAME:
    image: IMG
    container_name: CONTAINER_NAME
    ports:
      - "0.0.0.0:HOST_PORT:CONTAINER_PORT"

Leave a Reply