rapid_clay_formations_fab.docker

Docker compose commands to be used from python scripts.

compose_up

Run docker-compose up for specified compose file.

compose_down

Run docker-compose down for specified compose file.

restart_container

Run docker restart for specified container.

rapid_clay_formations_fab.docker.compose_up(path, overrides=None, force_recreate=False, remove_orphans=False, ignore_orphans=True, print_output=True, check_output=True, env_vars=None)[source]

Run docker-compose up for specified compose file.

Parameters:
  • path (os.PathLike) – Path to compose file.

  • overrides (list of os.PathLike, optional) – Docker compose override files, e.g. docker-compose.override.yml.

  • force_recreate (bool, optional) – Force recreation of containers specified in docker-compose file. Defaults to False.

  • remove_orphans (bool, optional) – Remove orphaned containers. Defaults to False.

  • ignore_orphans (bool, optional) – Don’t warn about orphaned containers (useful since the use of multiple compose files produces false positives for this check). Defaults to True.

  • print_output (bool, optional) – Print stdout and stdin generated by docker-compose command. Defaults to True.

  • check_output (bool, optional) – Raise if docker-compose fails. Defaults to True.

  • env_vars (dict, optional) – Environment variables to set before running docker-compose

rapid_clay_formations_fab.docker.compose_down(path, check_output=True, print_output=True)[source]

Run docker-compose down for specified compose file.

Parameters:
  • path (os.PathLike or str) – Path to compose file

  • print_output (bool, optional) – Print stdout and stdin generated by docker-compose command. Defaults to True.

  • check_output (bool, optional) – Raise if docker-compose fails. Defaults to True.

rapid_clay_formations_fab.docker.restart_container(container_name)[source]

Run docker restart for specified container.

Parameters:

container_name (str) – Name of container to restart.