Skip to content

Commit 0154a7b

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 5366cc1 commit 0154a7b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ RUN apk update && \
1717
apk add ca-certificates git openssh-client python3 py3-pip && \
1818
pip3 install --upgrade pip && \
1919
pip3 install awscli && \
20+
apk add gcc musl-dev python3-dev libffi-dev openssl-dev cargo make && \
21+
pip3 install azure-cli && \
2022
rm -rf /var/cache/apk/*
2123

2224
RUN mkdir -p /usr/local/bin

0 commit comments

Comments
 (0)