- Newest
- Most votes
- Most comments
Thanks for the help, Riku_Kobayashi. I think I found the issue.
For ping
, if I don't specify the -6
flag (which tells ping to use IPv6), the command prioritizes IPv4. Since I'm on an IPv6-only instance, that doesn’t work. I tried ping google.com -6
, and it works now.
As for curl github.com, I discovered that GitHub does not support IPv6, so it simply won't work on this instance.
Hello.
Since the IPv4 address can be confirmed when name resolution is performed within the container, we suspect that the Docker container is not configured for IPv6.
Have you configured it to support IPv6 using the steps in the document below?
https://docs.docker.com/engine/daemon/ipv6/
Hi,
Yes, I have configure Docker for IPv6 following the document:
- My
/etc/docker/daemon.json
looks like this:
{ "ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64" }
- I also set
enable_ipv6: true
inside my docker compose files:
# compose.traefik.yml name: traefik services: traefik: command: - --providers.docker=true - --providers.docker.exposedbydefault=false - --providers.file.directory=/etc/traefik/dynamic_conf - --providers.file.watch=true - --entrypoints.http.address=:80 - --entrypoints.https.address=:443 - --accesslog - --log - --api - --certificatesresolvers.myresolver.acme.tlschallenge=true - --certificatesresolvers.myresolver.acme.email=johndoe@example.com - --certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json image: traefik:v2.6 restart: unless-stopped labels: traefik.docker.network: traefik-public traefik.enable: "true" traefik.http.middlewares.https-redirect.redirectscheme.permanent: "true" traefik.http.middlewares.https-redirect.redirectscheme.scheme: https traefik.http.services.traefik-public.loadbalancer.server.port: "8080" networks: traefik-public: null ports: - mode: ingress target: 80 published: "80" protocol: tcp - mode: ingress target: 443 published: "443" protocol: tcp volumes: - type: bind source: /home/ubuntu/traefik/letsencrypt target: /letsencrypt bind: create_host_path: true - type: bind source: /home/ubuntu/traefik/certificates target: /certificates bind: create_host_path: true - type: bind source: /var/run/docker.sock target: /var/run/docker.sock read_only: true bind: create_host_path: true - type: bind source: ./traefik.config.yml target: /etc/traefik/dynamic_conf/conf.yml read_only: true bind: create_host_path: true networks: traefik-public: name: traefik-public enable_ipv6: true
# docker-compose.yml services: redis: image: redis:alpine restart: unless-stopped networks: bench-network: null frappe: image: jk1117/bench:erpnext-version-15 restart: unless-stopped command: sleep infinity environment: - SHELL=/bin/bash volumes: - bench-dir:/home/frappe/frappe-bench - sites:/home/frappe/frappe-bench/sites:rw - assets:/home/frappe/frappe-bench/apps:rw - templates:/home/frappe/.bench/bench/config/templates:rw networks: bench-network: null extra_hosts: - "actual.domain.com:[2406:da1c:31d:2d00:33df:130:e1a2:8478]" proxy: depends_on: frappe: condition: service_started restart: unless-stopped environment: BACKEND: frappe:8000 FRAPPE_SITE_NAME_HEADER: $$host SOCKETIO: frappe:443 UPSTREAM_REAL_IP_ADDRESS: 2406:da1c:31d:2d00:33df:130:e1a2:8478 UPSTREAM_REAL_IP_HEADER: X-Forwarded-For UPSTREAM_REAL_IP_RECURSIVE: "off" SERVER_NAME: actual.domain.com image: nginx:1.23.1 labels: traefik.docker.network: traefik-public traefik.enable: 'true' traefik.http.services.uat.loadbalancer.server.port: '8080' traefik.http.routers.uat-http.entrypoints: http traefik.http.routers.uat-http.rule: Host(`actual.domain.com`) traefik.http.routers.uat-http.service: uat traefik.http.routers.uat-http.middlewares: https-redirect traefik.http.routers.uat-https.rule: Host(`actual.domain.com`) traefik.http.routers.uat-https.entrypoints: https traefik.http.routers.uat-https.tls: true traefik.http.routers.uat-https.service: uat traefik.http.routers.uat-https.tls.certresolver: myresolver networks: traefik-public: null bench-network: null volumes: - ./nginx_templates:/etc/nginx/templates - sites:/usr/share/nginx/html/sites:rw - assets:/usr/share/nginx/html/assets:ro - templates:/usr/share/nginx/html/templates:ro volumes: bench-dir: assets: sites: templates: networks: bench-network: enable_ipv6: true traefik-public: name: traefik-public external: true enable_ipv6: true mariadb-network: name: mariadb-network external: true enable_ipv6: true
- I also verify the setup by running
docker run --rm --network ip6net -p 80:80 traefik/whoami
and the result is exactly the same as the documentation provided.
Am I missing any setting to enable IPv6 for Docker Compose?
Relevant content
- asked 7 months ago
- asked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 2 years ago
How about running the following command to enable NAT on the host OS side?