AntelopeIO / DUNES

Docker Utilities for Node Execution
Other
26 stars 20 forks source link

Stopping a container inefficiently requires starting one. #167

Open ScottBailey opened 1 year ago

ScottBailey commented 1 year ago

dunes --destroy-container will start a container before destroying one. This is very inefficient and, if the container has become corrupt, frustrating!

stephenpdeos commented 1 year ago

Many arguments do not require a running container (e.g. --version), however, the architecture currently requires one for member function calls. This can be fixed by converting the member functions into statics and calling them without creating the container. See --help for an example of a call that does not create a container.

ScottBailey commented 1 year ago

Right now, the dunes::docker object starts the container in init(). Instead, I think we should add some support functions to determine the container state (e.g. is_running(), is_exited(), is_stopped(), etc, ???) and some additional functions to control that state (e.g. start(), stop(), destroy()).