Images¶
Reference¶
DockerImages¶
- class aiodocker.images.DockerImages(docker)[source]¶
- build(*, remote: str = 'None', fileobj: BinaryIO = 'None', path_dockerfile: str = 'None', tag: str = 'None', quiet: bool = 'False', nocache: bool = 'False', buildargs: Mapping = 'None', pull: bool = 'False', rm: bool = 'True', forcerm: bool = 'False', labels: Mapping = 'None', stream: typing_extensions.Literal[False] = 'False', encoding: str = 'None') Dict[str, Any] [source]¶
- build(*, remote: str = 'None', fileobj: BinaryIO = 'None', path_dockerfile: str = 'None', tag: str = 'None', quiet: bool = 'False', nocache: bool = 'False', buildargs: Mapping = 'None', pull: bool = 'False', rm: bool = 'True', forcerm: bool = 'False', labels: Mapping = 'None', stream: typing_extensions.Literal[True], encoding: str = 'None') AsyncIterator[Dict[str, Any]]
Build an image given a remote Dockerfile or a file object with a Dockerfile inside
- Parameters
path_dockerfile (
Optional
[str
]) – path within the build context to the Dockerfileremote (
Optional
[str
]) – a Git repository URI or HTTP/HTTPS context URIquiet (
bool
) – suppress verbose build outputnocache (
bool
) – do not use the cache when building the imagerm (
bool
) – remove intermediate containers after a successful buildpull (
bool
) – downloads any updates to the FROM image in Dockerfilesencoding (
Optional
[str
]) – set Content-Encoding for the file object your sendforcerm (
bool
) – always remove intermediate containers, even upon failurelabels (
Optional
[Mapping
]) – arbitrary key/value labels to set on the imagefileobj (
Optional
[BinaryIO
]) – a tar archive compressed or not
- Return type
- coroutine delete(self, name, *, force=False, noprune=False)[source]¶
Remove an image along with any untagged parent images that were referenced by that image
- export_image(name)[source]¶
Get a tarball of an image by name or id.
- Parameters
name (
str
) – name/id of the image to be exported- Returns
Streamreader of tarball image
- import_image(data, stream=False)[source]¶
Import tarball of image to docker.
- Parameters
data – tarball data of image to be imported
- Returns
Tarball of the image
- pull(from_image: str, *, auth: Optional[Union[MutableMapping, str, bytes]] = 'None', tag: str = 'None', repo: str = 'None', stream: typing_extensions.Literal[False] = 'False') Dict[str, Any] [source]¶
- pull(from_image: str, *, auth: Optional[Union[MutableMapping, str, bytes]] = 'None', tag: str = 'None', repo: str = 'None', stream: typing_extensions.Literal[True]) AsyncIterator[Dict[str, Any]]
Similar to docker pull, pull an image locally
- Parameters
fromImage – name of the image to pull
repo (
Optional
[str
]) – repository name given to an image when it is importedtag (
Optional
[str
]) – if empty when pulling an image all tags for the given image to be pulledauth (
Union
[MutableMapping
,str
,bytes
,None
]) – special {‘auth’: base64} pull private repo
- Return type
- push(name: str, *, auth: Union[MutableMapping, str, bytes] = 'None', tag: str = 'None', stream: typing_extensions.Literal[False] = 'False') Dict[str, Any] [source]¶
- push(name: str, *, auth: Union[MutableMapping, str, bytes] = 'None', tag: str = 'None', stream: typing_extensions.Literal[True]) AsyncIterator[Dict[str, Any]]
- Return type