Docker Module

utils.docker.is_docker_running()[source]

Check if Docker daemon is running.

Returns

bool

True if Docker daemon is running, False otherwise.

utils.docker.is_container_running(container_name)[source]

Check if a Docker container is running.

Parameters

container_namestr

Name of the Docker container.

Returns

bool

True if the container is running, False otherwise.

utils.docker.start_container(container_name, compose_file, build=True)[source]

Start a Docker container using docker compose.

Parameters

container_namestr

Name of the Docker container to start.

compose_filestr

Path to the docker compose file.

Returns

None

utils.docker.stop_container(container_name, compose_file)[source]

Stop a Docker container using docker compose.

Parameters

container_namestr

Name of the Docker container to stop.

compose_filestr

Path to the docker compose file.

Returns

None

utils.docker.ensure_container_running(container_name, compose_file, build=True)[source]

Ensure that a Docker container is running. If not, start it.

Parameters

container_namestr

Name of the Docker container.

compose_filestr

Path to the docker compose file.

Returns

None