Closed chris-aeviator closed 2 years ago
Hello,
I think it's because you are not using the right version, I recommend using an explicit version because the management of the latest
tag (no tag means latest
) by Docker can be surprising.
version: '3.7'
services:
fake-service:
image: traefik/whoami:v1.7.1
environment:
- 'WHOAMI_PORT_NUMBER=3993'
$ docker-compose up
issue-traefik-fake-service-1 | 2022/01/08 14:00:18 Starting up on port 3993
v1.10.2 and it still does not work:
% docker-compose up
Recreating kanboard_kanboard_1 ... done
Starting kanboard_whoami_1 ... done
Attaching to kanboard_whoami_1, kanboard_kanboard_1
whoami_1 | 2024/06/25 11:02:39 Starting up on port 2001
version: '2'
services:
kanboard:
image: kanboard/kanboard:latest
ports:
- "8081:80"
- "4443:443"
volumes:
- kanboard_data:/var/www/app/data
- kanboard_plugins:/var/www/app/plugins
- kanboard_ssl:/etc/nginx/ssl
environment:
- PLUGIN_INSTALLER=true
# - WHOAMI_PORT_NUMBER=81
whoami:
# A container that exposes an API to show its IP address
image: traefik/whoami:v1.10.2
command:
- --port=2001
- --name=whoami_kanboard
labels:
- "traefik.http.routers.whoami.rule=Host(`kanboard.localhost`)"
- "traefik.http.services.home.loadbalancer.server.port=8081"
volumes:
kanboard_data:
driver: local
kanboard_plugins:
driver: local
kanboard_ssl:
driver: local
/var/lib/docker/volumes/ docker container ls | egrep 'traefik|whoami'
f757fa3a77ce traefik/whoami:v1.10.2 "/whoami --port=2001…" 16 seconds ago Up 13 seconds 80/tcp kanboard_whoami_1
92b417382e59 traefik:v3.0 "/entrypoint.sh --ap…" 40 minutes ago Up 18 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp traefik_reverse-proxy_1
When using the env variable instead of the --port
command it is ignored completley.
% docker-compose up
Starting kanboard_kanboard_1 ... done
Starting kanboard_whoami_1 ... done
Attaching to kanboard_whoami_1, kanboard_kanboard_1
whoami_1 | 2024/06/25 11:04:20 Starting up on port 80
Changing the tag from empty to the given version does not change the behaviour.
@DDzwiedziu I can confirm it is working with traefik/whoami:v1.10.2
docker image.
$ docker run --rm -e WHOAMI_PORT_NUMBER=1234 traefik/whoami:v1.10.2
Unable to find image 'traefik/whoami:v1.10.2' locally
v1.10.2: Pulling from traefik/whoami
Digest: sha256:1474027c316661cdec87df2623e13a41e7e1ce0ba99c24917631de8f300b5420
Status: Downloaded newer image for traefik/whoami:v1.10.2
2024/06/25 13:39:06 Starting up on port 1234
running
will still bring up