Utility functions to deal with docker.

Module Contents

runner.docker.is_docker_working() → bool[source]

Check if we can successfully connect to the docker daemon.

runner.docker.docker_has_experimental() → bool[source]

Return True if the docker daemon has experimental mode enabled. We use this to produce squashed images.


Make sure the derex network necessary for our docker-compose files to work is in place.

runner.docker.check_services(services: Iterable[str]) → bool[source]

Check if the services needed for running Open edX are running.

runner.docker.wait_for_service(service: str, check_command: str, max_seconds: int = 20)[source]

With a freshly created container services might need a bit of time to start. This functions waits up to max_seconds seconds.


Loads a mysql dump into the derex mysql database.

runner.docker.build_image(dockerfile_text: str, paths: List[str], tag: str, tag_final: bool = False, extra_opts: Dict = {})[source]

Build a docker image. Prepares a build context (a tar stream) based on the paths argument and includes the Dockerfile text passed in dockerfile_text.

runner.docker.pull_images(image_names: List[str])[source]

Pull the given image to the local docker daemon.

runner.docker.image_exists(needle: str) → bool[source]

If the given image tag exist in the local docker repository, return True.

exception runner.docker.BuildError[source]

Bases: RuntimeError

An error occurred while building a docker image

Initialize self. See help(type(self)) for accurate signature.

runner.docker.get_running_containers() → Dict[source]
runner.docker.get_exposed_container_names() → List[source]

Invoke a minio shell