Create and manage Docker containers and images
Source: target-root/usr/local/libexec/solidgroundux/manage-docker-containers.sh
Create and manage Docker containers and images
Public functions
Internal functions
| Function | Purpose | Arguments | Output |
|---|---|---|---|
_dryrun_complete | Report the dry-run result without executing the requested host change. | — | — |
_docker_require_daemon | Check that the Docker daemon is available for container operations. | — | — |
_docker_validate_name | Validate the proposed Docker container name. | — | — |
_docker_trim | Remove leading and trailing whitespace from the supplied value. | - $1: Value to inspect or write. | — |
_docker_print_command | Format a command for dry-run reporting without executing it. | — | — |
_docker_validate_port | Accept a decimal TCP/UDP port number from 1 through 65535. | - $1: Value to inspect or write. | — |
_docker_validate_absolute_path | Reject empty, root-only, relative, and multiline host paths. | - $1: Value to inspect or write. | — |
_docker_validate_env_name | Check that a variable name follows the environment-key syntax. | — | — |
_docker_select_labeled_value | Prompt for a value while displaying separate labels and optional explanatory details. | - $1: Name of the shell variable receiving the result. | — |
_docker_select_container | Prompt for an existing Docker container and return its identifier. | - $1: Name of the shell variable receiving the result. | — |
_docker_select_local_image | Prompt for a locally available Docker image. | - $1: Name of the shell variable receiving the result. | — |
_docker_search_hub_repository | Search Docker Hub for repositories matching the supplied query. | - $1: Name of the shell variable receiving the result. | — |
_docker_list_hub_tags | Retrieve available tags for the selected Docker Hub repository. | - $1: Docker Hub image repository. | — |
_docker_select_hub_tag | Prompt for the desired image tag from Docker Hub results. | - $1: Name of the shell variable receiving the result. | — |
_docker_select_restart_policy | Prompt for a Docker container restart policy. | - $1: Name of the shell variable receiving the result. | — |
_docker_collect_port_mappings | Collect and validate host-to-container port mappings for container creation. | - $1: Name of the selected item. | — |
_docker_collect_volume_mappings | Collect host-volume-to-container path mappings for container creation. | - $1: Name of the selected item. | — |
_docker_collect_environment | Collect environment-variable assignments for a new Docker container. | - $1: Name of the selected item. | — |
_docker_ask_selection | Present numbered Docker management choices and write the selection to an output variable. | - $2: Name of the output shell variable. | — |
_docker_list_containers | Display existing Docker containers and their current states. | — | — |
_docker_list_images | Display locally stored Docker images. | — | — |
_docker_inspect_container | Display detailed configuration for a selected Docker container. | — | — |
_docker_show_logs | Display or follow logs for the selected Docker container. | — | — |
_docker_pull_image | Pull the selected repository and tag from a Docker image registry. | — | — |
_docker_create_container | Collect settings and create a Docker container from an available image. | — | — |
_docker_start_container | Start the selected Docker container. | — | — |
_docker_stop_container | Stop the selected running Docker container. | — | — |
_docker_restart_container | Restart the selected Docker container. | — | — |
_docker_open_container_shell | Let an operator enter a running container without having to remember docker exec syntax. | — | — |
_docker_remove_container | Confirm and remove the selected Docker container. | — | — |
_docker_action_again | Give repeatable Docker management actions the standard SolidGroundUX | — | — |
_docker_return_to_menu | Let read-only Docker actions end naturally without offering a redundant repeat option. | — | — |
_run_action | Dispatch the requested management action to its implementation. | - $1: Management action to execute. | — |
Description
Provides guided Docker image discovery, image pulling, container creation, and common lifecycle operations without attempting to replace Docker Compose or a full container-management product. Docker Hub search/tag discovery is offered as the friendly default, with manual image references retained as a fallback.
Usage
Run the executable from its shell command (or installed wrapper):
manage-docker-containers --action list
manage-docker-containers --dryrun --action create
Script-specific options:
--action NAME,-a: Management action (supported actions:list,create,start,stop,restart,shell,remove,inspect,logs,images,pull).
