Skip to content

Commit 781414d

Browse files
committed
feat: Allow ACR authentication using Azure CLI
Install azure-cli in Docker image in order to use the `az acr login` command. Can be used with Azure Managed Identities with the following script: ```yaml --- apiVersion: v1 kind: ConfigMap metadata: name: argocd-image-updater-config namespace: argocd data: log.level: debug registries.conf: | registries: - name: acrexample api_url: https://acrexample.azurecr.io/ prefix: acrexample.azurecr.io ping: yes insecure: no credentials: ext:/app/scripts/acr-login.sh credsexpire: 10h --- apiVersion: v1 kind: ConfigMap metadata: name: argocd-image-updater-config-acr namespace: argocd data: acr-login.sh: | #!/bin/sh LOGIN=$(az login --identity) REGISTRY="acrexample" TOKEN=$(az acr login --name $REGISTRY --expose-token --output tsv --query accessToken) echo "00000000-0000-0000-0000-000000000000:$TOKEN" ``` Closes argoproj-labs#550 and argoproj-labs#473 Signed-off-by: Francesc Arbona <[email protected]>
1 parent 980eff5 commit 781414d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ FROM alpine:3.21
1515
RUN apk update && \
1616
apk upgrade && \
1717
apk add ca-certificates git openssh-client aws-cli tini gpg gpg-agent && \
18+
apk add python3 py3-pip && \
19+
pip3 install --upgrade pip && \
20+
pip3 install awscli && \
21+
apk add gcc musl-dev python3-dev libffi-dev openssl-dev cargo make && \
22+
pip3 install azure-cli && \
1823
rm -rf /var/cache/apk/*
1924

2025
RUN mkdir -p /usr/local/bin

0 commit comments

Comments
 (0)