cloudposse / geodesic

🚀 Geodesic is a DevOps Linux Toolbox in Docker
https://cloudposse.com/accelerate
Apache License 2.0
953 stars 121 forks source link

Add a `destroy` command to the wrapper script to support removing the currently running geodesic container #798

Open Gowiem opened 2 years ago

Gowiem commented 2 years ago

Describe the Feature

It would be great to have a geodesic destroy or similar command to remove the currently running image.

Use Case

This would help in clearing the existing container in the case that the user no longer wants it around.

Describe Ideal Solution

geodesic destroy would lookup the running geodesic container ID and issue a docker rm $CONTAINER_ID against it.

Alternatives Considered

N/A

Additional Context

N/A

Nuru commented 1 year ago

I am inclined to close/refuse this request, because it seems to me to be a scary option, because it terminates all running shells without doing cleanup like saving shell history.

You can specify a container by name in the Docker CLI, e.g.

docker rm -f geodesic

which both seems to be easy enough to not warrant adding a separate Geodesic command and avoids Cloud Posse advocating or supporting such behavior.

osterman commented 1 year ago

I like the option. And if it's scary, then default to a prompt =)

Geodesic should be self-contained, and explaining other commands like calling docker directly should be avoided and considered workarounds.

Nuru commented 8 months ago

@Gowiem @osterman I'm a little unclear about what you want.

We recommend using the installed wrapper, which automatically removes the container image on termination, and has commands

If not using the installed wrapper, you can remove the container automatically with the --rm option to docker run.

If not using the installed wrapper and not using --rm, I am not sure how we can help you. Please elaborate.