cloudflared icon indicating copy to clipboard operation
cloudflared copied to clipboard

🐛 Cannot create tunnel with cloudflared docker image

Open ocodista opened this issue 3 years ago • 1 comments

Describe the bug With the following command, on a authenticated environment (that have the cert.pem file on the /etc/cloudflared folder), I am able to create a tunnel.

cloudflared tunnel --hostname myhostname.com --url localhost:80 --name mytunnel

So I was hoping that if I mapped the cert.pem file as a docker volume and run the same command I should be able to create a tunnel too.

But that is not happening, as the cloudflared image does not have permission to create the tunnel credentials file.

The command I'm running is this one /

docker run --network host -v $(pwd)/cert.pem:/etc/cloudflared/cert.pem -d --name cloudflared cloudflare/cloudflared:latest tunnel --hostname myhostname.com --url localhost:80 --name mytunnel

The error I'm getting is this one image

To Reproduce Steps to reproduce the behavior:

  1. Run docker run --network host -v $(pwd)/cert.pem:/etc/cloudflared/cert.pem -d --name cloudflared cloudflare/cloudflared:latest tunnel --hostname myhostname.com --url localhost:80 --name mytunnel
  2. See error

If it's an issue with Cloudflare Tunnel: 5. Tunnel ID : 6. cloudflared config:

Expected behavior Be able to create a tunnel directly from cloudflared docker image

Logs and errors The file-writting error is: open /etc/cloudflared/tunnel-id.json: permission denied The tunnel was deleted, because the tunnel can't be run without the credentials file

ocodista avatar Nov 23 '22 20:11 ocodista

Same here. Was working for half a year on 50+ tunnels but since today it didn't work in version 2022.11.0 and 2022.12.1

Ubuntu 22.04.

Example: docker run -d -v "/path/vpntunnel:/etc/cloudflared" -v "/path/cert_new.pem:/etc/cloudflared/cert.pem" -v "/path/config.yaml:/etc/cloudflared/config.yaml" --name tunnelcontainer cloudflare/cloudflared:latest tunnel create tunnelnamexyz

pin-alex avatar Dec 20 '22 16:12 pin-alex