Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit75f4176

Browse files
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

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎docker-compose.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ services:
2121
# - "998" # docker group on host
2222
volumes:
2323
-/var/run/docker.sock:/var/run/docker.sock
24+
# Run "docker volume rm coder_coder_home" to reset the dev tunnel url (https://abc.xyz.try.coder.app).
25+
# This volume is not required in a production environment - you may safely remove it.
26+
# Coder can recreate all the files it needs on restart.
27+
-coder_home:/home/coder
2428
depends_on:
2529
database:
2630
condition:service_healthy
@@ -47,3 +51,4 @@ services:
4751
retries:5
4852
volumes:
4953
coder_data:
54+
coder_home:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp