- Notifications
You must be signed in to change notification settings - Fork927
Commit75f4176
authored
fix: persist the devtunnel file in a docker volume (#15731)
Addresses#15663.This PR saves the entire coder home directory in a Docker volume to makethe dev tunnel URL persistent across container restarts.I initially wanted to persist only the config directory, but DockerCompose cannot set permissions on a named volume unless the directoryit’s mounted on already exists within the container. The`/home/coder/.config` directory, however, is not created by default inthe Dockerfile. When I attempt to mount it, [Docker creates it with rootpermissions](moby/moby#2259 (comment)),and Coder cannot write to it. I encounter the following error:```coder-1 | Started HTTP listener athttp://0.0.0.0:7080coder-1 | Opening tunnel so workspaces can connect to your deployment. For production scenarios, specify an external access URLcoder-1 | Encountered an error running "coder server", see "coder server --help" for more informationcoder-1 | error: create tunnel: read or generate config: get config path: mkdirall config dir "/home/coder/.config/coderv2": mkdir /home/coder/.config/coderv2: permission denied```Creating the directory in the Dockerfile would resolve the issue for newimages but would break `docker-compose.yml` for all existing Coderimages. Mounting the entire home directory avoids this problem, but itmakes it less clear to admins which files need to be persisted. It’s atrade-off - I believe keeping Docker Compose backwards-compatible ismore important, and I hope the added comment clarifies the purpose ofthe volume for new users.1 parent14a6030 commit75f4176
1 file changed
+5
-0
lines changedLines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 |
| |
25 | 29 |
| |
26 | 30 |
| |
| |||
47 | 51 |
| |
48 | 52 |
| |
49 | 53 |
| |
| 54 | + |
0 commit comments
Comments
(0)