docker_registry {AzureContainers}R Documentation

Create a new Docker registry object


Create a new Docker registry object


docker_registry(server, tenant = "common", username = NULL,
  password = NULL, app = .az_cli_app_id, ..., domain = "",
  token = NULL, login = TRUE)



The registry server. This can be a URL ("") or a domain name label ("myregistry"); if the latter, the value of the domain argument is appended to obtain the full hostname.

tenant, username, password, app, ...

Authentication arguments to AzureAuth::get_azure_token. See 'Details' below.


The default domain for the registry server.


An OAuth token, of class AzureAuth::AzureToken. If supplied, the authentication details for the registry will be inferred from this.


Whether to perform a local login (requires that you have Docker installed). This is necessary if you want to push or pull images.


There are two ways to authenticate with an Azure Docker registry: via Azure Active Directory (AAD), or with a username and password. The latter is simpler, while the former is more complex but also more flexible and secure.

The default method of authenticating is via AAD. Without any arguments, docker_registry will authenticate using the AAD credentials of the currently logged-in user. You can change this by supplying the appropriate arguments to docker_registry, which will be passed to AzureAuth::get_azure_token; alternatively, you can provide an existing token object.

To authenticate via the admin user account, set app=NULL and supply the admin username and password in the corresponding arguments. Note that for this to work, the registry must have been created with the admin account enabled.

Authenticating with a service principal can be done either indirectly via AAD, or via a username and password. See the examples below. The latter method is recommended, as it is both faster and allows easier interoperability with AKS and ACI.


An R6 object of class DockerRegistry.

See Also

DockerRegistry for methods available for interacting with the registry, call_docker

kubernetes_cluster for the corresponding function to create a Kubernetes cluster object


## Not run: 

# connect to the Docker registry '', authenticating as the current user

# same, but providing a full URL

# authenticating via the admin account
docker_registry("myregistry", username="admin", password="password", app=NULL)

# authenticating with a service principal, method 1: recommended
docker_registry("myregistry", username="app_id", password="client_creds", app=NULL)

# authenticating with a service principal, method 2
docker_registry("myregistry", app="app_id", password="client_creds")

# authenticating from a managed service identity (MSI)
token <- AzureAuth::get_managed_token("")
docker_registry("myregistry", token=token)

# you can also interact with a registry outside Azure
# note that some registry methods, and AAD authentication, may not work in this case
docker_registry("", username="mydockerid", password="password", app=NULL)

## End(Not run)

[Package AzureContainers version 1.3.2 Index]