lib/containers/engine.pm

create_container($image, $name, [$cmd])

Creates a container. image the name of the image we create the container from. name is the given name of the created container. cmd can be anything you want to run in the container, similar to run. for instance: docker create -it tumbleweed bash

start_container($image_name)

Starts container named image_name.

halt_container($container_name)

Blocks a container until exits. container_name which runs. https://docs.docker.com/engine/reference/commandline/wait/

build($dockerfile_path, $image_tag, [%args])

Build a container from a Dockerfil. dockerfile_path is the directory with the Dockerfile as well as the root of the build context. container_tag will be the name of the container. Give timeout if you want to change the timeout passed to assert_script_run. Default for containers is 300.

run_container($image_name, [mode, name, remote, keep_container, timeout, retry, delay])

Run a container. The method dies, if the run command fails. image_name is required and can be the image id, the name or name with tag. If daemon is enabled then container will run in the detached mode. Otherwise will be in the interactive mode. Set name is you want to name the container. if cmd found then it will execute the given command into the container. The container is always removed after exit. if keep_container is 1 the container is not removed after creation. Default to get removed when it exits or when the daemon exits if retry is given, the command is being repeated the given amount of times on failure If delay is given, this defines the number of seconds between retries

pull($image_name, [%args])

Pull a container with the given image_name where image_name can be the name or id of the image. args passes parameters to script_run

enum_images

Return an array ref of the images

enum_images

Return an array ref of the containers

info

Assert a property against given expected value if value is given. Otherwise it prints the output of info.

get_container_logs($container, $filename)

Request container's logs. container the running container. filename file the logs are written to.

remove_container($container_name, [assert])

Remove a container from the pool. container_name is the container name to be removed. Required argument. assert Is an optional boolean for asserting that the call is successful. If false the method returns the return value of the call.

check_image_in_host

Returns true if host contains img or false.

configure_insecure_registries

Updates the registry files for the running container runtime to allow access to insecure registries.

Implementation is subject to the subclass.

cleanup_system_host

Remove containers and then all the images respectively. Asserts that everything was cleaned up unless c<assert> is set to 0.