I'm currently running docker and docker-compose to automatically deploy my containers. My first container houses Apache and my second container houses Traefik as my reverse proxy. The following docker-compose file works when I use docker.
version: "3"
services:
traefik:
image: traefik:v3.0
container_name: traefik
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command:
- "--api.insecure=true"
- "--log.level=DEBUG"
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.web-secure.address=:443"
ports:
- "80:80"
- "443:443"
apache:
image: httpd:latest
container_name: apache
labels:
- "traefik.enable=true"
- "traefik.http.routers.apache.rule=Host(`example.com`)"
- "traefik.http.routers.apache.entrypoints=web"
- "traefik.http.services.apache.loadbalancer.server.port=80"
Browsing to example.com allows me to see the default apache page. When I try to migrate this set up to use containerd, with nerdctl which can read yaml files and deploy containers the same way docker-compose does, I cannot reach my site.
version: "3"
services:
traefik:
image: traefik:v3.0
container_name: traefik
volumes:
- /var/run/containerd/containerd.sock:/var/run/containerd/containerd.sock
command:
- "--api.insecure=true"
- "--log.level=DEBUG"
- "--providers.docker=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.web-secure.address=:443"
- "--providers.containerd.endpoint=unix:///var/run/containerd/containerd.sock"
ports:
- "80:80"
- "443:443"
apache:
image: httpd:latest
container_name: apache
labels:
- "traefik.enable=true"
- "traefik.http.routers.apache.rule=Host(`example.com`)"
- "traefik.http.routers.apache.entrypoints=web"
- "traefik.http.services.apache.loadbalancer.server.port=80"
When I start my containers, they all up and running, there are no errors in the traefik or apache logs, I can ping one container from the other which indicates the containers can communicate, and they are also all on the same subnet, but browsing to my site example.com doesn't work and the page throws the error 'the page can't be reached.'
Is there anything specific I'm missing in order to get this set up to function? I would appreciate any guidance in this regard.
- /run/containerd/containerd.sock:/run/containerd/containerd.sock
command:
- "--providers.containerd=true"