Simplified the process of constructing and executing container commands
to enhance maintainability and reduce redundancy.
- Removed redundant appending of image_tag and action to docker_opts in
run.cr.
- Modified command construction in docker_engine.cr to use pre-built cmd
array, enhancing clarity.
- Updated podman_engine.cr to utilize cmd array for process execution,
ensuring consistency across container engines.
Signed-off-by: Glenn Y. Rolland <glenux@glenux.net>
This commit introduces a comprehensive implementation and refactoring of
the container engine module. Key enhancements include the addition of
abstract classes and the implementation of container engines.
New features:
- Developed `DockerEngine` and `PodmanEngine` classes, deriving from
`AbstractContainerEngine` to provide modular functionality.
- Added a CLI `--container-runtime` option, allowing users to select
their preferred runtime, defaulting to Docker if unspecified.
- Introduced a `container_runtime` property in
`DocMachine::Build::Config` for improved runtime management.
Refactoring:
- Refactored code to replace hardcoded Docker commands with method calls
to `AbstractContainerEngine`, promoting code reuse and abstraction.
Signed-off-by: Glenn Y. Rolland <glenux@glenux.net>
Add support for base port selection
- add --port PORT and -p PORT options on command line
- add naive (not implemented) support for port detection
- docs container is now mapped to PORT
- slides container is now mapped to PORT+100