-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Unable to attach config file to read only filesystem #12031
Comments
Hello @s4s0l If you're block by this situation, I suggest you to use a config file instead of using the inline declaration as I supposed you don't want to change your container FS mode |
Thanks for the explanation, I ended up mounting config as volume (It didn't occur to me that config via file declaration could work any different). I just want to point out that inlined configs is a great feature. I can interpolate some env variables in config files right in compose file. Doing so with bind mounts or config via a file declaration, usually requires some scripting around;) |
Hello @glours I tried using an inline compose config on a read only container but with a tmpfs mount like so: services:
test:
image: busybox
read_only: true
tmpfs:
- /config:mode=777
configs:
- source: test_config
target: /config/test_config
configs:
test_config:
content: config_content But running
My intuition was that this should have worked because the config file copy should happen after the tmpfs is mounted, do you know when the copy happens exactly? (As @s4s0l I'm asking because the inline configuration is quite useful, notably because it interprets environment variables like the rest of the compose file) |
Hit this myself just now. Thanks for the explanation, @glours Saves me from trying to understand why this isn't working. I completely agree with @guillaumedsde as inlining configs with env support is super handy. Would be super nice to have this working. |
Description
I'm unable to attach config file to container when container has read-only filesystem.
Steps To Reproduce
docker compose up ends with:
Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: