| docker_image {stevedore} | R Documentation |
Management commands for working with a particular docker image
Description
Methods for working with a particular docker image. Image objects
are returned by building or pulling a docker image, or by using
$image$get to fetch an existing image by name or id.
Details
Below is reference documentation for all methods for version '1.29' of the docker API - other versions are available. This documentation is automatically generated from docker's API schema, and so inaccuracies may exist between it and stevedore's interface (especially references to JSON objects). Please report any documentation that might be improved at https://github.com/richfitz/stevedore/issues
Methods
image_tarballExport an image. Get a tarball containing all images and metadata for a repository.
If
nameis a specific name and tag (e.g.ubuntu:latest), then only that image (and its parents) are returned. Ifnameis an image ID, similarly only that image (and its parents) are returned, but with the exclusion of therepositoriesfile in the tarball, as there were no image names referenced.### Image tarball format
An image tarball contains one directory per image layer (named using its long ID), each containing these files:
VERSION: currently1.0- the file format versionjson: detailed layer information, similar todocker inspect layer_idlayer.tar: A tarfile containing the filesystem changes in this layer
The
layer.tarfile containsaufsstyle.wh..wh.aufsfiles and directories for storing attribute changes and deletions.If the tarball defines a repository, the tarball should also include a
repositoriesfile at the root that contains a list of repository and tag names mapped to layer IDs.json { "hello-world": { "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" } }. Similar to the cli command
docker image save.Usage:
image_tarball()
helpDisplay help for this object
Usage:
help(help_type = getOption("help_type"))Arguments:
help_type: Passed toutils::help, can be one of "text", "html" or "pdf" (or an abbreviation). By default it uses the valuegetOption("help_type")and should follow the same behaviour as other R help (e.g., using "?")
image_historyGet the history of an image. Return parent layers of an image. Similar to the cli command
docker image history.Usage:
image_history()
idReturn the image's id
Usage:
id()
inspectReturn detailed information about this image. Similar to the cli command
docker image inspect.Usage:
inspect(reload = TRUE)
Arguments:
reload: Logical scalar, indicating if the information should be refreshed from the daemon. This is useful to set toFALSEafter an image has been removed.
labelsReturn labels for this image
Usage:
labels(reload = TRUE)
Arguments:
reload: Logical scalar, indicating if the information should be refreshed from the daemon. This is useful to set toFALSEafter an image has been removed.
nameReturn name for this image
Usage:
name()
reloadRefresh infomation on the image from the server, returning
$inspect()invisibly.Usage:
reload()
image_deleteRemove an image. Remove an image, along with any untagged parent images that were referenced by that image.
Images can't be removed if they have descendant images, are being used by a running container or are being used by a build. Similar to the cli command
docker rmiordocker image rm.Usage:
image_delete(force = NULL, noprune = NULL)
Arguments:
force: Remove the image even if it is being used by stopped containers or has other tagsnoprune: Do not delete untagged parent images
short_idAbbreviated identifier, truncated to 10 characters (perhaps plus the leading
sha256:Usage:
short_id()
image_tagTag an image. Tag an image so that it becomes part of a repository. Similar to the cli command
docker tagordocker image tag.Usage:
image_tag(repo, tag = NULL)
Arguments:
repo: The repository to tag in. For example,someuser/someimage.tag: The name of the new tag.
tagsReturn tags for this image
Usage:
tags(reload = TRUE)
Arguments:
reload: Logical scalar, indicating if the information should be refreshed from the daemon. This is useful to set toFALSEafter an image has been removed.
untagRemove tags from the image. This is a lot like
image$remove(seedocker_image_collection) but withnoprune = TRUE.Usage:
untag(repo_tag)
Arguments:
repo_tag: Tags to remove
See Also
docker_image_collection for other
image management methods.