cloudflare / cloudflare/cloudflared
🐛 Cannot create tunnel with cloudflared docker image
- Dominant language
- Go
- Stars
- 15.6k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
**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

**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
Contributor guide
Assessment
This issue has not been assessed yet.