You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @s4s0l
So it's a good catch, you identified a corner case error of the inline declaration 😅
What happened, when you use a config via a file declaration this one is mounted into the container even if the FS is in Read only mode. But it doesn't work the same with inline declaration, Compose write the content directly inside the container via a docker cp command which will obviously failed when the FS is in RO
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;)
But it doesn't work the same with inline declaration, Compose write the content directly inside the container via a docker cp command which will obviously failed when the FS is in RO
Hello @glours I tried using an inline compose config on a read only container but with a tmpfs mount like so:
But running docker compose up (with docker 27.1.1 and compose 2.29.1) still yields:
Error response from daemon: container rootfs is marked read-only
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)
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: