Open ffoysal opened 4 years ago
Yeah this would be super helpful. 👍
There are two ways we could go about this (maybe more):
Commit the container at the end of the install so you can use the image. It wouldn't let you see env vars and state, just the file system. I have a hunch this is easier/quicker for us to do.
porter install --debug
Okay! All done and we kept a image for you to look at.
Run the following command to see what the container looked like at the end:
docker run -it --rm porter-debug-last
$
We can add a flag that says start the container and leave it running.
$ porter install --debug --pause-for-attach
Okay! All done and it is ready for you to attach to look at.
Run the following command to see the container.
Once you are done, run `porter debug cleanup` to remove the running container.
docker exec -it porter-debug bash
$
I like 2 (of course), but that's just a vote here. This is part of the larger introspection issue: how do you vet a bundle, understand it, and so on, prior to, during, and subsequent to using it? There's a metaissue here. :-)
You can set the environment variable CLEANUP_CONTAINERS=true
and your stopped container will be left behind for you to troubleshoot. To re-enter the container, run docker ps
to see the container id, use docker commit CONTAINER_ID NEWIMAGENAME
, then docker run --rm -it --entrypoint bash NEWIMAGENAME
to look around.
I'm keeping this open as a documentation issue. Let's take this info above and put it into our bundle author docs as a task "e.g. debugging a bundle"
Turns out I had more interesting ideas for how to support this #1727. Since that may not happen for a while, I'll keep this open to document the workaround today.
For now let's just document CLEANUP_CONTAINERS on the website. It can be a task for bundle authors to help them troubleshoot a bundle when they are writing one.
Describe the bug
after running
porter install
is it possible to access the container that being used duringporter install
so that we can see the files being used or generated duringporter install
.To Reproduce
NA
Expected behavior
something like this ...
docker start <porter-install-container>
docker exec -it <porter-install-container> bash