- Notifications
You must be signed in to change notification settings - Fork927
fix: persist the devtunnel file in a docker volume#15731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Makes sense, considering the home is not intended to be used for anything other than config, this approach should work just fine. 👍🏻
docker-compose.yaml Outdated
@@ -21,6 +21,10 @@ services: | |||
# - "998" # docker group on host | |||
volumes: | |||
- /var/run/docker.sock:/var/run/docker.sock | |||
# Use "docker volume rm coder_coder_home" to reset the dev tunnel url (https://abc.xyz.try.coder.app) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
#Use "docker volume rm coder_coder_home" to reset the dev tunnel url (https://abc.xyz.try.coder.app) | |
#Run "docker volume rm coder_coder_home" to reset the dev tunnel url (https://abc.xyz.try.coder.app). |
75f4176
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Addresses#15663.
This PR saves the entire coder home directory in a Docker volume to make the dev tunnel URL persistent across container restarts.
I initially wanted to persist only the config directory, but Docker Compose cannot set permissions on a named volume unless the directory it’s mounted on already exists within the container. The
/home/coder/.config
directory, however, is not created by default in the Dockerfile. When I attempt to mount it,Docker creates it with root permissions, and Coder cannot write to it. I encounter the following error:Creating the directory in the Dockerfile would resolve the issue for new images but would break
docker-compose.yml
for all existing Coder images. Mounting the entire home directory avoids this problem, but it makes it less clear to admins which files need to be persisted. It’s a trade-off - I believe keeping Docker Compose backwards-compatible is more important, and I hope the added comment clarifies the purpose of the volume for new users.