A rudimentary Python tool used to manage the execution of software within Docker containers on a single machine. This is done in an encapsulated manner, allowing multiple containers to be run simultaneously and independently. See ARCHITECTURE.md for my thoughts on tradeoffs when implementing this tool under a 3 hour time constraint.
- Accept a bash command.
- Launch a Docker container to run the command.
- Collect logs real-time (STDOUT/STDERR) while the command runs.
- The logs should be saved and identifiable in a logs directory.
- Clean up when the command finishes and handle expected failures.
- Have the ability to stop a specified container (without losing any logs).
- Make the file executable
chmod +x <script_name>
- Run some command inside a container
./script_name -r 'my command'
- To have more control over bash and run longer commands
./script_name -b 'my super long command with -options'
- To stop a specified container
./script_name stop 'container_name_or_id'
- To kill a container
./script_name kill 'container_name_or_id'