Learn R Programming

AzureContainers (version 1.0.2)

acr: Azure Container Registry class

Description

Class representing an Azure Container Registry (ACR) resource. For working with the registry endpoint itself, including uploading and downloading images etc, see docker_registry.

Usage

acr

Arguments

Format

An object of class R6ClassGenerator of length 24.

Methods

The following methods are available, in addition to those provided by the AzureRMR::az_resource class:

  • new(...): Initialize a new ACR object. See 'Details'.

  • list_credentials: Return the username and passwords for this registry. Only valid if the Admin user for the registry has been enabled.

  • list_policies: Return the policies for this registry.

  • list_usages: Return the usage for this registry.

  • get_docker_registry(username, password): Return an object representing the Docker registry endpoint.

Details

Initializing a new object of this class can either retrieve an existing registry resource, or create a new registry on the host. Generally, the best way to initialize an object is via the get_acr, create_acr or list_acrs methods of the az_resource_group class, which handle the details automatically.

Note that this class is separate from the Docker registry itself. This class exposes methods for working with the Azure resource: listing credentials, updating resource tags, updating and deleting the resource, and so on.

For working with the registry, including uploading and downloading images, updating tags, deleting layers and images etc, use the endpoint object generated with get_docker_registry. This method takes two optional arguments:

  • username: The username that Docker will use to authenticate with the registry.

  • password: The password that Docker will use to authenticate with the registry.

By default, these arguments will be retrieved from the ACR resource. They will only exist if the resource was created with admin_user_enabled=TRUE. Currently AzureContainers does not support authentication methods other than a username/password combination.

See Also

create_acr, get_acr, delete_acr, list_acrs

docker_registry for interacting with the Docker registry endpoint

Azure Container Registry and API reference

Examples

Run this code
# NOT RUN {
# recommended way of retrieving a registry: via a resource group object
rg <- AzureRMR::az_rm$
    new(tenant="myaadtenant.onmicrosoft.com", app="app_id", password="password")$
    get_subscription("subscription_id")$
    get_resource_group("rgname")

myacr <- rg$get_acr("myregistry")

myacr$list_credentials()
myacr$list_policies()

# get the registry endpoint
dockerreg <- myacr$get_docker_registry()

# }

Run the code above in your browser using DataLab