DockerRegistry {AzureContainers} | R Documentation |
Docker registry class
Description
Class representing a Docker registry. Note that this class can be used to interface with any Docker registry that supports the HTTP V2 API, not just those created via the Azure Container Registry service. Use the docker_registry function to instantiate new objects of this class.
Methods
The following methods are available, in addition to those provided by the AzureRMR::az_resource class:
-
login(...)
: Do a local login to the registry viadocker login
; necessary if you want to push and pull images. By default, instantiating a new object of this class will also log you in. See 'Details' below. -
push(src_image, dest_image, ...)
: Push an image to the registry, usingdocker tag
anddocker push
. -
pull(image, ...)
: Pull an image from the registry, usingdocker pull
. -
get_image_manifest(image, tag="latest")
: Gets the manifest for an image. -
get_image_digest(image, tag="latest")
: Gets the digest (SHA hash) for an image. -
delete_image(image, digest, confirm=TRUE)
: Deletes an image from the registry. -
list_repositories()
: Lists the repositories (images) in the registry.
Details
The arguments to the login()
method are:
-
tenant
: The Azure Active Directory (AAD) tenant for the registry. -
username
: The username that Docker will use to authenticate with the registry. This can be either the admin username, if the registry was created with an admin account, or the ID of a registered app that has access to the registry. -
password
: The password that Docker will use to authenticate with the registry. -
app
: The app ID to use to authenticate with the registry. Set this to NULL to authenticate with a username and password, rather than via AAD. -
...
: Further arguments passed to AzureAuth::get_azure_token. -
token
: An Azure token object. If supplied, all authentication details will be inferred from this.
The login()
, push()
and pull()
methods for this class call the docker
commandline tool under the hood. This allows all the features supported by Docker to be available immediately, with a minimum of effort. Any calls to the docker
tool will also contain the full commandline as the cmdline
attribute of the (invisible) returned value; this allows scripts to be developed that can be run outside R.
See Also
acr, docker_registry, call_docker
Examples
## Not run:
reg <- docker_registry("myregistry")
reg$list_repositories()
# create an image from a Dockerfile in the current directory
call_docker(c("build", "-t", "myimage", "."))
# push the image
reg$push("myimage")
reg$get_image_manifest("myimage")
reg$get_image_digest("myimage")
## End(Not run)