runway.cfngin.hooks.docker.image package¶
Docker image actions & argument parsers.
Replicates the functionality of docker image
CLI commands.
- pydantic model runway.cfngin.hooks.docker.image.DockerImageBuildApiOptions[source]¶
Bases:
BaseModel
Options for controlling Docker.
Show JSON schema
{ "title": "DockerImageBuildApiOptions", "description": "Options for controlling Docker.", "type": "object", "properties": { "buildargs": { "additionalProperties": true, "default": {}, "title": "Buildargs", "type": "object" }, "custom_context": { "default": false, "title": "Custom Context", "type": "boolean" }, "extra_hosts": { "additionalProperties": { "type": "string" }, "default": {}, "title": "Extra Hosts", "type": "object" }, "forcerm": { "default": false, "title": "Forcerm", "type": "boolean" }, "isolation": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Isolation" }, "network_mode": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Network Mode" }, "nocache": { "default": false, "title": "Nocache", "type": "boolean" }, "platform": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Platform" }, "pull": { "default": false, "title": "Pull", "type": "boolean" }, "rm": { "default": true, "title": "Rm", "type": "boolean" }, "squash": { "default": false, "title": "Squash", "type": "boolean" }, "tag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Tag" }, "target": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Target" }, "timeout": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Timeout" }, "use_config_proxy": { "default": false, "title": "Use Config Proxy", "type": "boolean" } } }
- field extra_hosts: dict[str, str] = {}¶
Extra hosts to add to /etc/hosts in the build containers. Defined as a mapping of hostname to IP address.
- pydantic model runway.cfngin.hooks.docker.image.ImageBuildArgs[source]¶
Bases:
BaseModel
Args passed to image.build.
Show JSON schema
{ "title": "ImageBuildArgs", "type": "object", "properties": { "ctx": { "default": null, "title": "Ctx" }, "ecr_repo": { "anyOf": [ { "$ref": "#/$defs/ElasticContainerRegistryRepository" }, { "type": "null" } ], "default": null }, "path": { "default": "/home/docs/checkouts/readthedocs.org/user_builds/runway/checkouts/stable/docs/source", "format": "directory-path", "title": "Path", "type": "string" }, "dockerfile": { "default": "Dockerfile", "title": "Dockerfile", "type": "string" }, "repo": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Repo" }, "docker": { "$ref": "#/$defs/DockerImageBuildApiOptions", "default": { "buildargs": {}, "custom_context": false, "extra_hosts": {}, "forcerm": false, "isolation": null, "network_mode": null, "nocache": false, "platform": null, "pull": false, "rm": true, "squash": false, "tag": null, "target": null, "timeout": null, "use_config_proxy": false } }, "tags": { "default": [ "latest" ], "items": { "type": "string" }, "title": "Tags", "type": "array" } }, "$defs": { "DockerImageBuildApiOptions": { "description": "Options for controlling Docker.", "properties": { "buildargs": { "additionalProperties": true, "default": {}, "title": "Buildargs", "type": "object" }, "custom_context": { "default": false, "title": "Custom Context", "type": "boolean" }, "extra_hosts": { "additionalProperties": { "type": "string" }, "default": {}, "title": "Extra Hosts", "type": "object" }, "forcerm": { "default": false, "title": "Forcerm", "type": "boolean" }, "isolation": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Isolation" }, "network_mode": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Network Mode" }, "nocache": { "default": false, "title": "Nocache", "type": "boolean" }, "platform": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Platform" }, "pull": { "default": false, "title": "Pull", "type": "boolean" }, "rm": { "default": true, "title": "Rm", "type": "boolean" }, "squash": { "default": false, "title": "Squash", "type": "boolean" }, "tag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Tag" }, "target": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Target" }, "timeout": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Timeout" }, "use_config_proxy": { "default": false, "title": "Use Config Proxy", "type": "boolean" } }, "title": "DockerImageBuildApiOptions", "type": "object" }, "ElasticContainerRegistry": { "description": "AWS Elastic Container Registry.", "properties": { "account_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Account Id" }, "alias": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Alias" }, "public": { "default": true, "title": "Public", "type": "boolean" }, "aws_region": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Aws Region" } }, "title": "ElasticContainerRegistry", "type": "object" }, "ElasticContainerRegistryRepository": { "description": "AWS Elastic Container Registry (ECR) Repository.", "properties": { "repo_name": { "title": "Repo Name", "type": "string" }, "registry": { "$ref": "#/$defs/ElasticContainerRegistry" } }, "required": [ "repo_name", "registry" ], "title": "ElasticContainerRegistryRepository", "type": "object" } } }
- field ctx: Annotated[CfnginContext | None, Field(alias='context', exclude=True)] = None (alias 'context')¶
- field docker: Annotated[DockerImageBuildApiOptions, Field(validate_default=True)] = DockerImageBuildApiOptions(buildargs={}, custom_context=False, extra_hosts={}, forcerm=False, isolation=None, network_mode=None, nocache=False, platform=None, pull=False, rm=True, squash=False, tag=None, target=None, timeout=None, use_config_proxy=False)¶
Options for
docker image build
.
- field ecr_repo: ElasticContainerRegistryRepository | None = None¶
AWS Elastic Container Registry repository information. Providing this will automatically construct the repo URI. If provided, do not provide
repo
.If using a private registry, only
repo_name
is required. If using a public registry,repo_name
andregistry_alias
.
- field path: DirectoryPath = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/runway/checkouts/stable/docs/source')¶
Path to the directory containing the Dockerfile.
- Constraints:
path_type = dir
- pydantic model runway.cfngin.hooks.docker.image.ImagePushArgs[source]¶
Bases:
BaseModel
Args passed to image.push.
Show JSON schema
{ "title": "ImagePushArgs", "type": "object", "properties": { "ctx": { "default": null, "title": "Ctx" }, "ecr_repo": { "anyOf": [ { "$ref": "#/$defs/ElasticContainerRegistryRepository" }, { "type": "null" } ], "default": null }, "image": { "default": null, "title": "Image" }, "repo": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Repo" }, "tags": { "default": [], "items": { "type": "string" }, "title": "Tags", "type": "array" } }, "$defs": { "ElasticContainerRegistry": { "description": "AWS Elastic Container Registry.", "properties": { "account_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Account Id" }, "alias": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Alias" }, "public": { "default": true, "title": "Public", "type": "boolean" }, "aws_region": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Aws Region" } }, "title": "ElasticContainerRegistry", "type": "object" }, "ElasticContainerRegistryRepository": { "description": "AWS Elastic Container Registry (ECR) Repository.", "properties": { "repo_name": { "title": "Repo Name", "type": "string" }, "registry": { "$ref": "#/$defs/ElasticContainerRegistry" } }, "required": [ "repo_name", "registry" ], "title": "ElasticContainerRegistryRepository", "type": "object" } } }
- field ctx: Annotated[CfnginContext | None, Field(alias='context', exclude=True)] = None (alias 'context')¶
- field ecr_repo: ElasticContainerRegistryRepository | None = None¶
AWS Elastic Container Registry repository information. Providing this will automatically construct the repo URI. If provided, do not provide
repo
.If using a private registry, only
repo_name
is required. If using a public registry,repo_name
andregistry_alias
.
- field image: DockerImage | None = None¶
Image to push.
- pydantic model runway.cfngin.hooks.docker.image.ImageRemoveArgs[source]¶
Bases:
BaseModel
Args passed to image.remove.
Show JSON schema
{ "title": "ImageRemoveArgs", "type": "object", "properties": { "ctx": { "default": null, "title": "Ctx" }, "ecr_repo": { "anyOf": [ { "$ref": "#/$defs/ElasticContainerRegistryRepository" }, { "type": "null" } ], "default": null }, "force": { "default": false, "title": "Force", "type": "boolean" }, "image": { "default": null, "title": "Image" }, "noprune": { "default": false, "title": "Noprune", "type": "boolean" }, "repo": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Repo" }, "tags": { "default": [], "items": { "type": "string" }, "title": "Tags", "type": "array" } }, "$defs": { "ElasticContainerRegistry": { "description": "AWS Elastic Container Registry.", "properties": { "account_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Account Id" }, "alias": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Alias" }, "public": { "default": true, "title": "Public", "type": "boolean" }, "aws_region": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Aws Region" } }, "title": "ElasticContainerRegistry", "type": "object" }, "ElasticContainerRegistryRepository": { "description": "AWS Elastic Container Registry (ECR) Repository.", "properties": { "repo_name": { "title": "Repo Name", "type": "string" }, "registry": { "$ref": "#/$defs/ElasticContainerRegistry" } }, "required": [ "repo_name", "registry" ], "title": "ElasticContainerRegistryRepository", "type": "object" } } }
- field ctx: Annotated[CfnginContext | None, Field(alias='context', exclude=True)] = None (alias 'context')¶
- field ecr_repo: ElasticContainerRegistryRepository | None = None¶
AWS Elastic Container Registry repository information. Providing this will automatically construct the repo URI. If provided, do not provide
repo
.If using a private registry, only
repo_name
is required. If using a public registry,repo_name
andregistry_alias
.
- field image: DockerImage | None = None¶
Image to push.
- runway.cfngin.hooks.docker.image.build(*, context: runway.context.CfnginContext, **kwargs: Any) DockerHookData [source]¶
Docker image build hook.
Replicates the functionality of
docker image build
CLI command.kwargs are parsed by
ImageBuildArgs
.
- runway.cfngin.hooks.docker.image.push(*, context: runway.context.CfnginContext, **kwargs: Any) DockerHookData [source]¶
Docker image push hook.
Replicates the functionality of
docker image push
CLI command.kwargs are parsed by
ImagePushArgs
.
- runway.cfngin.hooks.docker.image.remove(*, context: runway.context.CfnginContext, **kwargs: Any) DockerHookData [source]¶
Docker image push remove.
Replicates the functionality of
docker image push
CLI command.kwargs are parsed by
ImageRemoveArgs
.