-
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
Allow compose to run arbitrary commands at the host level after or before containers are started #2012
Comments
I don't think I understand the issue.
If you need to run something on the host there are many tools to accomplish that task. Makefiles and bash scripts are probably the most common. |
Sure, it just means I'm adding another tool to do what docker-compose could do to help set up arbitrary config... I guess the only use case I can see right now is pipework or manual configuration of the network since docker still isn't quite there yet. |
Ahh right, that's basically what I'd like. Closing this then. |
I have a use case. In dev, I need to start a database container but not on live. In dev, the database container needs to have it's data loaded from the host AFTER IT STARTS. If I bring it up beforehand and get it ready then I have to fight the networking between the containers to work properly because docker compose is setting up a network that does not exist before running 'up'. It would be useful for compose to do everything. Any other ideas are also appreciated. |
It would be interesting to have it I have a docker container that runs an X application, but I need to run like that xhost +local:docker && docker compose up I'd rather only run |
Apologies for posting on an old issue, but having such a mechanism could be useful for generating/refreshing credentials which are only exposed to the host, and need to be passed to containers using environment variables such as |
'command' - works inside a container composer definition currently and from what I understand overrides the default cmd
Can you also pull it back out to the top level or host level?
This would allow scenarios that currently have to be managed outside of docker-compose.
e,g,
couchbase1:
container_name: couchbase1
image: couchbase/server:community-3.0.1
volumes:
- /opt/couchbase/node1:/opt/couchbase/var
net: none
command: pipework add br1 couchbase 192.168.1.1@192.168.1.254
That would of course make command a keyword at the top level, but that's a small sacrifice and should be fairly easy to implement.
Unless someone has a better idea.
The text was updated successfully, but these errors were encountered: