cloudflare / cloudflare/cloudflared

🐛 Cannot create tunnel with cloudflared docker image

Open
#822 1 comment 0 reactions 0 assignees View on GitHub
Priority: Normal Type: Bug
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
![image](https://user-images.githubusercontent.com/19851187/203642026-3f3ab55b-185e-4a4d-a03c-d8631577b2fb.png)

**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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.