Argo Tunnels - Docker Compose

I have no issue running argo tunnels in docker with:
docker run -it --rm -v /configs/cloudflared:/home/nonroot/.cloudflared/ cloudflare/cloudflared:2021.8.1 tunnel run

When I try to convert the same tunnel to using docker-compose (to run alongside the rest of my containers), the container just seems to hang, and just seems to restart every so often, without bringing up the tunnels
[email protected]:~$ docker logs cloudflare
cloudflared version (built 2021-08-04-0841 UTC)
cloudflared version (built 2021-08-04-0841 UTC)
cloudflared version (built 2021-08-04-0841 UTC)
cloudflared version (built 2021-08-04-0841 UTC)
cloudflared version (built 2021-08-04-0841 UTC)
cloudflared version (built 2021-08-04-0841 UTC)
cloudflared version (built 2021-08-04-0841 UTC)
cloudflared version (built 2021-08-04-0841 UTC)
cloudflared version (built 2021-08-04-0841 UTC)
cloudflared version (built 2021-08-04-0841 UTC)
cloudflared version (built 2021-08-04-0841 UTC)

The options are the same as the docker container, so I’m not sure why I can run it with docker run, and not as part of the docker-compose config that run the rest of the docker containers within my infra.

Is there anything that could point me in the direction that I’m going wrong?
Thank you

What is your docker-compose.yml configuration?

I use configuration like this for my application, maybe you can compare yours with mine:

cloudflared:
        container_name: '${CLOUDFLARED_NAME}' # name obtained from environment variable
        hostname: 'docker-${CLOUDFLARED_NAME}' # name obtained from environment variable
        image: 'cloudflare/cloudflared:${CLOUDFLARED_VERSION}' # version obtained from environment variable
        network_mode: host # I use host networking because I want to tunnel a specific port opened on my host system
        volumes:
            - '${PWD}/cloudflared/:/etc/cloudflared/'
        command: 'tunnel --config /etc/cloudflared/config.yml run'
        user: root
        restart: 'on-failure'
1 Like

Whoops, I thought I had added that:
cloudflare:
container_name: cloudflare
restart: unless-stopped
image: cloudflare/cloudflared:2021.8.1
depends_on:
- “nginx”
volumes:
- /configs/cloudflared:/home/nonroot/.cloudflared/

Will do some testing with the user and command parameters.

Thank you

1 Like

Just needed to add command: ‘tunnel run’
Thank you very much!

Now to get Teams setup!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.