ocaml / ocaml/infrastructure

Docker Swarm Services with IPv6

Open
#30 9 comments 3 reactions 1 assignee View on GitHub

@avsm is already working on this.

Since May 16, 2023.

Dominant language
HTML
Stars
42
Forks
11
PR merge metrics
No merged PRs in 30d

Description

IPv6 does not work as expected with docker service deploy.

Using this trivial docker-compose.yml as an example.

version: "3.9"

services:

  caddy:
    image: caddy
    ports:
      - "80:80"
    volumes:
      - /etc/caddy:/etc/caddy:ro

  nginx:
    image: nginx

/etc/caddy/Caddyfile contains a reverse proxy definition like this:

:80 {
        reverse_proxy nginx:80
}

Basic connectivity can be checked using using docker compose up and using curl http://<ipv4>:80 and curl http://<ipv6>:80, which both return the nginx default website.

After docker swarm init, the stack can be deployed using docker stack deploy --compose-file ./docker-compose.yml test. Connectivity tests on IPv6 now fail. IPv4 works as expected.

Updating /etc/docker/daemon.json by adding ipv6 and fixed-cidr-v6 as described here does not help.

The situation can be worked around by deploying the caddy image with host ports like this. Now, IPv4 and IPv6 connectivity work.

version: "3.9"

services:

  caddy:
    image: caddy
    deploy:
      mode: global
    ports:
      - target: 80
        published: 80
        protocol: tcp
        mode: host
    volumes:
      - /etc/caddy:/etc/caddy:ro

  nginx:
    image: nginx

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.