Traefik.yml is a directoy

Hello,
I have followed the video of Christian "https://www.youtube.com/watch?v=wLrmmh1eI94"

And I have this in the log of traffic, and it won't start
My docker file :
services:
traefik:
image: docker.io/library/traefik:v3.0.1
container_name: traefik
ports:
- 80:80
- 443:443
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./config/traefik.yaml:/etc/traefik/traefik.yaml:ro
- ./config/conf/:/etc/traefik/conf/
- ./config/certs/:/etc/traefik/certs/
restart: unless-stopped


image

But I have the file, and it's not a directory...

and we go to the mounted folder;
Docker creates a directory, and not a file ?? :confused:
Someone can help me, please... It took 2hours to debug, and I did"t find the solution
Yes my file name is traefik.yml and on the config it is traefik.yaml, when I put it on the config .yml I have the same error

image

Thanks by advance to someone can help me!

Can you post your up command that you are running to create the container.

I use portainer to start the container,
I put the compose file in stack menu

Are you using Docker Desktop on Windows? Note that it creates a VM to run Linux containers inside. Make sure your local config files are present inside that VM.

Update: It's probably just a typo. yml and yaml.

I use docker and portioner in my Debian LXC on my promox.
And even if my file name yml or yaml, it doesn't work, I thought the same thing..., but the problem isn't with the file name :confused:

If you mount a non-existing file into the container, Docker might just think it should be a folder instead.

Go into your Traefik container and check:

docker exec -it <c-id> sh
ls -la /etc/traefik/traefik.yml
ls -la /etc/traefik/traefik.yaml

I will try this evening,
And if you look my screenshot, you can see the files are good in /etc/traefik :confused:

You don't seem to understand. If you create a Docker bind mount with a non-existing file, Docker will assume you want to create a directory and will usually create a directory inside the container.

So if you use - ./config/traefik.yaml:/etc/traefik/traefik.yaml:ro and the file does not exist, then /etc/traefik/traefik.yamlcould be a directory inside. If Traefik tries to read traefik.yaml before traefik.yml, then it would fail with the error message.

Clean up your config, use 3 backticks before and after code/config. And be aware you tutorial is 2 years old, so probably made for Traefik v2. You try to use Traefik v3, which is a major release meaning some breaking changes.

Maybe check simple Traefik example.

Hi @bluepuma77 ,
Here the result after put there command

docker exec -it <c-id> sh ls -la /etc/traefik/traefik.yml ls -la /etc/traefik/traefik.yaml

image

And /etc/traefik/traefik.yml is an empty directory.