You can run AzCopy using a Docker container pulled from the Azure Container Registry (azcopycontainers.azurecr.io). This requires authenticating with Azure and the specific registry before pulling and running the image.
Prerequisites
- Azure CLI installed: You must have the
az CLI available. - Docker installed: You must have a Docker runtime available on your machine.
- Permissions: You need access to the
azcopycontainers registry.
Workflow
1. Authenticate with Azure
Log in to your Azure account using the Azure CLI:
az login
2. Authenticate with the Azure Container Registry (ACR)
Log in to the specific registry hosting the AzCopy images:
az acr login --name azcopycontainers
3. Locate the Image
List the available repositories in the registry to find the correct <imagename> and <tag>:
az acr repository list --name azcopycontainers --output table
4. Pull the Image
Download the desired image to your local machine:
docker pull azcopycontainers.azurecr.io/<imagename>:<tag>
5. Run AzCopy via Docker
To execute an AzCopy command, run the container with a volume mount to allow AzCopy to access your local files. Use the --rm flag to automatically remove the container after the command completes.
Command Pattern:
docker run --rm -it -v /local/path/to/mount:/azcopy azcopycontainers.azurecr.io/<imagename>:<tag> azcopy copy <source> <destination>
Note on Volume Mounting: The -v /local/path/to/mount:/azcopy flag maps a directory on your host machine to the /azcopy directory inside the container. Ensure your <source> or <destination> paths in the azcopy command are relative to or absolute within the container's filesystem (e.g., /azcopy/mydata).
docker run --rm -it -v /local/path/to/mount:/azcopy azcopycontainers.azurecr.io/<imagename>:<tag> azcopy copy <source> <destination>