Repository navigation
Conversation
ba3915c to
c08e5c8
Compare
|
I realized that this PR is a duplicate of #11871. I think the PR #11871 could benefit from the changes in the file pkg/compose/create.go made in this PR. I will also add this suggestion in a comment on #11871. |
…it into the container Signed-off-by: schaubl <schaubl@users.noreply.github.com>
c08e5c8 to
f54922f
Compare
ndeloof
left a comment
There was a problem hiding this comment.
One challenge we need to address here is that we have some users who rely on bind mounts being used. While a simple workaround is for them to declare an explicit bind mount, this would still be a breaking change.
| } | ||
| content = env | ||
| } else if file.File != "" { | ||
| data, err := os.ReadFile(file.File) |
There was a problem hiding this comment.
file can actually be a folder. Need to change logic here to produce tar, not just extract content
Currently, Docker Compose copies a config or secret into the container if the source is an environment variable or inlined content. However, if the source is a file, the file is bind mounted into the container. This approach fails when Docker Compose is invoked on a different filesystem than the Docker daemon host filesystem (e.g., when called from within a container or remotely using the -H option).
This PR changes the behavior for file-based config/secret sources to match the handling of environment variables and inlined content. Specifically, it reads the file from the filesystem where Docker Compose is executed (like Docker Stack) and copies it into the container.
This update enhances the functionality of Docker Compose when run "remotely," providing the ability to push configuration files, a feature previously available only with Docker Stack/Swarm.
What I did: