June 25, 2020·4 min read·engineeringdockerazurecontexts

Docker contexts can now target Azure Container Instances

The ACI beta changes a Docker context from a choice of engine into a choice of execution platform. Familiar commands now need an explicit account of their target and supported behavior.

Moving a container from a laptop to a cloud service often requires another deployment description and another command-line tool. Docker's Azure Container Instances integration attempts to reduce that translation. The Desktop Edge 2.3.2.0 release notes, dated 25 June, include the beta integration. A Docker context can now select ACI as the destination for familiar container operations.

This develops the direction Docker described in its May partnership announcement. Chad Metcalf explained that contexts had let developers select local or remote engines and other orchestrators. Extending that selection to a managed container service makes the context responsible for more than choosing the address of another Docker engine. It selects a different implementation of the operation the developer requests.

I value the ability to transfer a built environment between machines. A cloud integration is useful when it preserves the image and application description while reducing the separate configuration needed to execute them. It also needs to make the execution target clear, because a familiar command can now create a resource outside the local machine.

A context identifies the Azure destination

The documentation available at the release describes signing into Azure through Docker and creating an ACI context. The interactive creation command uses the login to identify subscriptions and resource groups. It lets the developer choose those resources, with flags also available for explicit selection. The documented beta syntax is the relevant syntax for this release, rather than the earlier demonstration in May.

docker login azure
docker context create aci myacicontext
docker --context myacicontext run -p 80:80 nginx

This is the documentation's simple web-server example. It uses an unpinned image reference to demonstrate the integration, so it should not be mistaken for a fully specified application release. The important change is the context argument. It directs the run request to ACI while leaving the image and port mapping recognizable to someone familiar with local Docker commands.

The documentation also permits selecting the context as the default with docker context use. That changes what subsequent commands target. Explicit context arguments are particularly useful in an explanation or automation because the destination remains visible alongside the requested operation. A command copied into another terminal otherwise depends on the state of that terminal's current context.

Familiar commands operate on cloud resources

Microsoft's launch announcement describes using docker run for a single-container application and docker compose up for a multi-container application. The container image comes from a registry such as Docker Hub or Azure Container Registry. Developers can inspect the running container and read its logs through Docker commands. The announcement identifies the release as the first available Desktop integration with Azure.

The registry is part of the deployment path. The example does not upload an arbitrary local filesystem as part of docker run. It refers to an image the service can obtain. That distinction follows from Microsoft's description of running the registry image and matters when comparing the demonstration with a local build workflow. Building an image and making it available to the execution platform remain separate operations.

The value of a shared command is therefore specific. It reduces the number of interfaces a developer must learn for the supported operations. It does not establish that the cloud service and local engine have identical behavior in every case. Understanding the context still requires understanding which platform will execute the request and how that platform obtains its inputs.

Compose support has a documented limit

The beta documentation supports docker compose up and docker compose down for a complete application. It documents docker-compose.yaml in the working directory as the default input, with file and working-directory options for other arrangements. An explicit project name can override the name derived from the working directory. These details determine which application definition and identity the integration uses.

However, the same document says the integration cannot fetch a combined log stream from every container in a Compose application. It directs developers to obtain container identifiers with docker ps and then read individual container logs. The application can be managed as a group without every diagnostic operation yet offering the same grouping.

I find that limitation useful to state alongside the deployment capability. A developer needs to understand both the unit of lifecycle management and the unit of observation. Launching an application through one command does not imply that every later question about it has a single application-wide answer in the beta tooling.

Resource groups define the visible namespace

The documentation allows multiple ACI contexts, each associated with a unique Azure resource group. It describes those contexts as namespaces. Running docker ps lists containers in the current context, and application or container names do not contend across two such contexts. Switching context therefore changes both the destination for new resources and the set of existing resources visible through the command.

That is consequential when interpreting an empty listing. The result describes the selected namespace. It is not an inventory of every container associated with the person's Azure credentials. A context-aware workflow keeps subscription and resource-group selection close to the operations that depend on them. The context is part of the command's meaning, even when the command itself is unchanged.

Linux users have a separate installation path in the same documentation. The integration CLI delegates local-engine operations to an existing Docker CLI named com.docker.cli on the executable search path. That arrangement makes the implementation boundary visible. The new command can provide ACI behavior while retaining the existing client for local work, instead of requiring the local engine to become an Azure service or implement Azure authentication itself.

This release is explicitly a beta, and its documentation says commands and flags may change. The available integration makes ACI a concrete target for Docker tooling while exposing the boundaries of the first implementation. Its context records the Azure destination, its images remain registry inputs, and its application lifecycle support already extends to Compose. Those are the specific agreements an engineer can rely on when interpreting the initial workflow.