-
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
Support `cp' sub command #3593
Comments
@bechtoldt What should |
|
@ocramz ^ |
That would be an awesome feature. On top of that a support of |
+1 for this feature. need copy some files into running container |
+1.... having to build a container to get a large file or 2 updates is a pain. |
As a workaround, you can do:
Now /file-on-container.sql will exist on your running container:
|
I use this bash alias:
:) |
With a "files" option in Compose which can copy local file to remote container between creation and starting process, it could be amazing to inject config files and secrets 👍 With local docker daemon, you can use "volumes" to map local file in a container, but it is not possible with remote docker daemon.
|
The workarounds suggested here are not bad, but the prime reason to want this is so that the |
Wouldn't it make more sense to use the service name rather than the container name ? So that we're in sync with the syntax of
|
How would it work if there are multiple instances of the same service? |
Was there any resolution to this? I think this would be a very nice feature! |
Currently not. I'm using |
I think this feature will be great!! |
Is this topic still alive? It would be great to be able to use 'cp' with service tags instead of container name (which can be dynamic). |
Sorry. I was doing other things. 😅 |
Any update on this? Ran into a use case where this would have been helpful. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This is not stale, still relevant and necessary |
This issue has been automatically marked as not stale anymore due to the recent activity. |
See also #5523 (and the comment containing my workaround) As demonstrated there, the |
2nd of June 2020 now, (almost) two entire years after the first proposal... Any news about replacing "a whack ton of time and space to build one image per configuration file and deploying 27000 different images" with "just a copy command in your compose yaml"? I would need to deploy a demo of a service, with that scope in mind, I need to use a sqlite3 file instead of keeping everything on memory to allow me to use known admin credentials and not let people administer whatever they want (even in the demo image). |
@bryanpedini It's my understanding that your use case is a docker anti-pattern. Docker containers are intended to be ephemeral. In other words, configuration management should be managed at either startup, as part of the entry point scripts, or done real time (with caching) with APIs to a configuration management services (AWS SSM parameter store, spring configuration server, etc, etc). |
@TrentonAdams while I agree that @bryanpedini 's particular case isn't 100% "docker-esque" ... there are still use cases where this would be convenient... For example, copying a small number of small files (e.g. crypto keys) into the image at startup. Sure, could use a volume or even build a custom image but those options (while certainly docker-esque) seem like such overkill for 2 or 3 ~5kb files. Especially if you want to customize on a per-image basis. Further, with docker-compose, if you're copying in the files at each start in the yaml... that's still ephemeral. (I guess it's kinda like a "mini" layer at the end of the container image at that point...) @bryanpedini Perhaps you can "docker cp" into the containers created by docker-compose? |
@danieldjewell That sounds like the job of a startup script. e.g. enabling an env var that has data that gives permission to a crypto service, then connecting to said crypto service and grabbing keys for your needs. In the case of AWS for example, your container would receive an IAM access key for a role, which has permissions to use AWS KMS. Or, you can put those keys (text only) themselves into ENV vars (not secure), if you're not using such services. Or mount the files. Or if you're using pure docker, it has facilities to share secret data. Mounting files, using docker's secrets, or using a configuration service at startup, is usually the best option. |
@TrentonAdams My understanding (which can be totally biased/wrong, not native Eng speaker here) of the situation is that Docker was not "meant" for this type of thing, tho IMO it's so much convenient to administer an image/container instead of an entire service on the host machine. |
Not meant for what type of thing? |
There's a really good use case for this. In a CI system, I want to run tests in a docker container and get a coverage report. The actual docker host is a remote machine so I can't use simple volume mounts. Therefore, the only way to get the coverage report is to |
|
sorry, I'm not all informed on the current news about everything in IT, but from my understanding what is now |
compose v2 is indeed a docker - actually a CLI plugin (separated binary) but will be distributed with the docker CLI. For now it's still beta so need to be installed in addition to the docker CLI, see https://github.com/docker/compose-cli#compose-v2-aka-local-docker-compose |
For now,
docker-compose cp
is missing. :)The text was updated successfully, but these errors were encountered: