azure-cli: ACR login does not work with podman
az feedbackauto-generates most of the information requested below, as of CLI version 2.0.62
Describe the bug az acr login --name registry You may want to use ‘az acr login -n registry --expose-token’ to get an access token, which does not require Docker to be installed. An error occurred: DOCKER_COMMAND_ERROR Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg
To Reproduce
install: podman, podman-docker emulator for CLI
Expected behavior az acr login to work
Environment summary
RHEL8. Rhel8 does not have docker anymore.
If you do dnf install docker it will install podman and podman-docker for CLI backwards compatibility.
Additional context
With growing podman addition would be good for this to work out of the box. With or without podman-docker package.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 46
- Comments: 26 (2 by maintainers)
Commits related to this issue
- [ACR] Fix #14768: `az acr login`: Add environment Variable for docker command (#28443) — committed to Azure/azure-cli by git001 3 months ago
This worked for me on MacOS:
For any readers hoping to do this in powershell and with WSL2, I’ve translated the workaround to something you can put in your powershell profile (
code $profileto edit your profile with vscode):Usage:
acrlogin <your-registry>@yugangw-msft with Docker Desktop 4.0’s change of terms the story for using docker with WSL becomes less ergonomic & raises the value of podman compatibility in aks. Unfortunately the feedback links in this thread are dead, redirecting to https://azure.microsoft.com/en-us/feedback
I found some information on this blog: https://www.danielstechblog.io/running-podman-on-macos-with-multipass/ I just set the link, executed
podman machine initandpodman machine startand it worked 😃Mac Homebrew M1
ln -s /opt/homebrew/bin/podman /usr/local/bin/docker || trueMac Homebrew Intel
ln -s /usr/local/bin/podman /usr/local/bin/docker || trueI was able to get it working with
--expose-tokeninaz acr login, followed by--creds=00000000-0000-0000-0000-000000000000:{shellescape(accessToken)}when invokingpodman pushSuboptimal, but it works
These can also be combined into one command:
The socket approach will only work with systemd, because Podman is daemonless and the socket is activated by a systemd unit.
Since podman gets a sufficient replacement for docker, which has multiple advantages, e.g. rootless usage this becomes more and more used in the community. Could you please add podman support to the
az acrtool. The workaround may work for specific cases, but there are cases e.g.az acr check-healthwhere the mentioned workarounds are not helping.@murphy85’s approach worked for me but required just a minor tweak for using on WSL. After this,
az acr loginworked as expected.Note: an alias in
~/.bashrcwas not sufficient.+1 We are currently using Azure Container Registry and would like to explore using podman as well.
@kalkin i have tried the following and unfortunately it did not work for me
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock
i still get this:
az acr login --name ***** You may want to use ‘az acr login -n acrtestlowers01 --expose-token’ to get an access token, which does not require Docker to be installed. 2023-02-15 18:02:42.622443 An error occurred: DOCKER_COMMAND_ERROR Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.