question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ACR login does not work with podman

See original GitHub issue

az feedback auto-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.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:29
  • Comments:19 (2 by maintainers)

github_iconTop GitHub Comments

19reactions
djdscommented, Sep 7, 2021
#!/bin/bash

# Copyright (c) 2021 djds <djds@bghost.xyz>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


set -euo pipefail

readonly USERNAME='00000000-0000-0000-0000-000000000000'


acr_password() {
    local -r registry="${1}"

    set +x
    az acr login \
        --name "${registry}" \
        --expose-token  \
        2>/dev/null \
        | jq -r '.accessToken'
}


podman_login() {
    local -r registries=("${@}")

    for registry in "${registries[@]}"; do
        printf "%s: %s\n" "${registry}" "$(
            acr_password "${registry}" \
                | podman login \
                    --username "${USERNAME}" \
                    --password-stdin \
                    "${registry}.azurecr.io"
        )"
    done
}


podman_login "${@}"
unset -f acr_password podman_login  # if wrapping this whole script as a function
./podman-login.sh ${registry} [${registry}] ...
8reactions
serprexcommented, Aug 31, 2021

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

ACR login with podman · Community - Azure Feedback
An error occurred: DOCKERCOMMANDERROR Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msgTo Reproduce install: podman, podman-docker ...
Read more >
Troubleshoot login to registry - Azure Container Registry
This article helps you troubleshoot problems you might encounter when logging into an Azure container registry. Symptoms. May include one or ...
Read more >
podman-login
DESCRIPTION¶. podman login logs into a specified registry server with the correct username and password. If the registry is not specified, the first...
Read more >
Pushing a Docker image - Amazon ECR - AWS Documentation
You can push your container images to an Amazon ECR repository with the docker ... to an Amazon ECR registry, run the aws...
Read more >
How to implement a simple personal/private Linux container ...
Podman is the container engine and htpasswd provides authentication. Install Podman and httpd-tools. Install the podman package to run the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found