images_build¶
Mixin for Image build support.
- class BuildMixin[source]¶
Bases:
object
Class providing build method for ImagesManager.
- build(**kwargs) Tuple[Image, Iterator[bytes]] [source]¶
Returns built image.
- Keyword Arguments:
path (str) –
Dockerfile. (fileobj – A file object to use as the) –
tag (str) –
quiet (bool) –
nocache (bool) –
rm (bool) –
timeout (int) –
custom_context (bool) – Optional if using fileobj (ignored) –
encoding (str) – The encoding for a stream. Set to gzip for compressing (ignored) –
pull (bool) –
forcerm (bool) –
dockerfile (str) –
buildargs (Mapping[str,str) –
container_limits (Dict[str, Union[int,str]]) –
- A dictionary of limits applied to each container created by the build process.
Valid keys:
memory (int): set memory limit for build
memswap (int): Total memory (memory + swap), -1 to disable swap
cpushares (int): CPU shares (relative weight)
cpusetcpus (str): CPUs in which to allow execution, For example, “0-3”, “0,1”
cpuperiod (int): CPU CFS (Completely Fair Scheduler) period (Podman only)
cpuquota (int): CPU CFS (Completely Fair Scheduler) quota (Podman only)
shmsize (int) – If omitted the system uses 64MB
labels (Mapping[str,str]) –
cache_from (List[str]) –
target (str) –
network_mode (str) –
squash (bool) –
extra_hosts (Dict[str,str]) – containers, as a mapping of hostname to IP address.
platform (str) –
isolation (str) – Isolation technology used during build. (ignored) –
use_config_proxy (bool) – (ignored) –
http_proxy (bool) - Inject http proxy environment variables into container (Podman only) –
layers (bool) –
output (str) –
outputformat (str) –
- Returns:
first item is the podman.domain.images.Image built
second item is the build logs
- Raises:
BuildError – when there is an error during the build
APIError – when service returns an error
TypeError – when neither path nor fileobj is not specified