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
docker-compose inspect #4155
Comments
|
Hello friend, I made a module to solve this https://github.com/jsrun/docker-compose-remote-api |
I agree! It would be very useful to have the commands available to docker itself also available to docker-compose. |
Why was this closed? |
It won't be implemented. For the rare cases where it would be useful, people can use |
docker inspect only works if you setup your --project_name correctly. |
I don't get it... why is then |
+1 I would like to be able to write a script to check if a container is running but if the containers were started using compose and not named, then I don't know the name. |
It would be great to be able to inspect docker-compose containers so one does not need to know the project name beforehand. |
For what it's worth: You can do something like (assuming the service to check is named
Hope that helps. |
Is there a way to get the docker-compose project name programmatically? For example, there is no consistent way to remove named volumes programmatically. |
I tried your suggestion and it works well for docker-compose.yml service definitions where one did not use Is there anything one can do in the case described above? Thank you |
@larssb I'm not sure if I get you right but maybe this helps?
|
Hi @deeky666 Sure ... I might not have explained myself properly. If I for some reason, forgot, lost or for whatever reason, do not have the project name used. So I can't use the Thank you. |
If I do I get a container named : project_service_1 Then this will return data Ez but shame. |
I just happened across this issue trying to debug an odd problem with a container where I need to inspect one of the compose containers from inside a CI script. It seems bizarre not to include an easy to use |
You can inspect docker-compose containers like this: docker inspect $(docker ps -f label=com.docker.compose.project.working_dir="$PWD" -f label=com.docker.compose.service=service_name --format '{{.ID}}') If you want to use container id in scripts, you can do this: CONTAINER_ID=$(docker ps -f label=com.docker.compose.project.working_dir="$PWD" -f label=com.docker.compose.service=service_name --format '{{.ID}}') |
Thank you for putting that together. I will make use of it. It is still rather obscure and complicated for interacting with the cli by hand. It isn't viewable without scrolling on a 3000px wide monitor =P
|
### What does this PR do? * Adds the inspect tab to Compose which is an array of "container inspect" from docker / podman. * Inspect is JSON array of containers, see docker/compose#4155 for inspiration (they don't actually have a `compose inspect` command..) * Adds tests ### Screenshot/screencast of this PR <!-- Please include a screenshot or a screencast explaining what is doing this PR --> ### What issues does this PR fix or reference? <!-- Please include any related issue from Podman Desktop repository (or from another issue tracker). --> Closes containers#3192 ### How to test this PR? 1. Deploy a compose example 2. Click on the compose group 3. Select the inspect tab <!-- Please explain steps to reproduce -->
### What does this PR do? * Adds the inspect tab to Compose which is an array of "container inspect" from docker / podman. * Inspect is JSON array of containers, see docker/compose#4155 for inspiration (they don't actually have a `compose inspect` command..) * Adds tests ### Screenshot/screencast of this PR <!-- Please include a screenshot or a screencast explaining what is doing this PR --> ### What issues does this PR fix or reference? <!-- Please include any related issue from Podman Desktop repository (or from another issue tracker). --> Closes containers#3192 ### How to test this PR? 1. Deploy a compose example 2. Click on the compose group 3. Select the inspect tab <!-- Please explain steps to reproduce --> Signed-off-by: Charlie Drage <charlie@charliedrage.com>
### What does this PR do? * Adds the inspect tab to Compose which is an array of "container inspect" from docker / podman. * Inspect is JSON array of containers, see docker/compose#4155 for inspiration (they don't actually have a `compose inspect` command..) * Adds tests ### Screenshot/screencast of this PR <!-- Please include a screenshot or a screencast explaining what is doing this PR --> ### What issues does this PR fix or reference? <!-- Please include any related issue from Podman Desktop repository (or from another issue tracker). --> Closes containers#3192 ### How to test this PR? 1. Deploy a compose example 2. Click on the compose group 3. Select the inspect tab <!-- Please explain steps to reproduce --> Signed-off-by: Charlie Drage <charlie@charliedrage.com>
### What does this PR do? * Adds the inspect tab to Compose which is an array of "container inspect" from docker / podman. * Inspect is JSON array of containers, see docker/compose#4155 for inspiration (they don't actually have a `compose inspect` command..) * Adds tests ### Screenshot/screencast of this PR <!-- Please include a screenshot or a screencast explaining what is doing this PR --> ### What issues does this PR fix or reference? <!-- Please include any related issue from Podman Desktop repository (or from another issue tracker). --> Closes containers#3192 ### How to test this PR? 1. Deploy a compose example 2. Click on the compose group 3. Select the inspect tab <!-- Please explain steps to reproduce --> Signed-off-by: Charlie Drage <charlie@charliedrage.com>
### What does this PR do? * Adds the inspect tab to Compose which is an array of "container inspect" from docker / podman. * Inspect is JSON array of containers, see docker/compose#4155 for inspiration (they don't actually have a `compose inspect` command..) * Adds tests ### Screenshot/screencast of this PR <!-- Please include a screenshot or a screencast explaining what is doing this PR --> ### What issues does this PR fix or reference? <!-- Please include any related issue from Podman Desktop repository (or from another issue tracker). --> Closes containers#3192 ### How to test this PR? 1. Deploy a compose example 2. Click on the compose group 3. Select the inspect tab <!-- Please explain steps to reproduce --> Signed-off-by: Charlie Drage <charlie@charliedrage.com>
### What does this PR do? * Adds the inspect tab to Compose which is an array of "container inspect" from docker / podman. * Inspect is JSON array of containers, see docker/compose#4155 for inspiration (they don't actually have a `compose inspect` command..) * Adds tests ### Screenshot/screencast of this PR <!-- Please include a screenshot or a screencast explaining what is doing this PR --> ### What issues does this PR fix or reference? <!-- Please include any related issue from Podman Desktop repository (or from another issue tracker). --> Closes containers#3192 ### How to test this PR? 1. Deploy a compose example 2. Click on the compose group 3. Select the inspect tab <!-- Please explain steps to reproduce --> Signed-off-by: Charlie Drage <charlie@charliedrage.com>
### What does this PR do? * Adds the inspect tab to Compose which is an array of "container inspect" from docker / podman. * Inspect is JSON array of containers, see docker/compose#4155 for inspiration (they don't actually have a `compose inspect` command..) * Adds tests ### Screenshot/screencast of this PR <!-- Please include a screenshot or a screencast explaining what is doing this PR --> ### What issues does this PR fix or reference? <!-- Please include any related issue from Podman Desktop repository (or from another issue tracker). --> Closes #3192 ### How to test this PR? 1. Deploy a compose example 2. Click on the compose group 3. Select the inspect tab <!-- Please explain steps to reproduce --> Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Hi all,
Are there any plans for docker-compose inspect command?
One could get e.g. exposed ports of given service
Thanks
The text was updated successfully, but these errors were encountered: