Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: *unauthorized: authentication required* on docker compose push to ACR #19224

Closed
1 of 4 tasks
khamza85 opened this issue Nov 5, 2023 · 1 comment
Closed
1 of 4 tasks

Comments

@khamza85
Copy link

khamza85 commented Nov 5, 2023

Task name

Azure CLI

Task version

2.229.0

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu 22.04.3

Task log

/usr/bin/az login --service-principal -u *** --password=*** --tenant [hidden] --allow-no-subscriptions
23:13:08 [INF] > /usr/bin/az acr login --name myacr
23:13:10 [DBG] Login Succeeded
23:13:10 [INF] > /usr/bin/docker compose build --push

Relevant log output

23:13:22 [DBG] #10 [x] pushing myacr.azurecr.io/poc/docker-compose:20231105.5 with docker
23:13:22 [DBG] #10 pushing layer 5f70bf18a086 0.1s done
23:13:22 [DBG] #10 pushing layer 37d625053e3d 0.1s done
23:13:22 [DBG] #10 pushing layer 623c87dfb411
23:13:22 [DBG] #10 pushing layer cc2447e1835a
23:13:22 [DBG] #10 pushing layer 37d625053e3d 0.1s done
23:13:22 [DBG] #10 pushing layer 623c87dfb411 0.1s done
23:13:22 [DBG] #10 pushing layer cc2447e1835a 0.1s done
23:13:22 [DBG] #10 ERROR: unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.
23:13:22 [DBG] ------
23:13:22 [DBG]  > [x] pushing myacr.azurecr.io/poc/docker-compose:20231105.5 with docker:
23:13:22 [DBG] ------
##[error]unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.
##[debug]Processed: ##vso[task.logissue type=error]unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.
23:13:22 [ERR] unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.

Aditional info

My compose.yml

version: '3.8'
name: 'my-compose'

services:
  x:
    image: myacr.azurecr.io/poc/docker-compose:20231105.5
    build: .

The Dockerfile:

FROM bash
RUN echo 'Foo'

Thy AzDO yaml pipeline:

- task: AzureCLI@2
  inputs:
    scriptType: bash
    scriptLocation: inlineScript
    azureSubscription: AzureServiceConnection
    inlineScript: my_script

my_script:

az acr login --name myacr
docker compose build --push

However, if I change my_script to

az acr login --name myacr
docker build -t myacr.azurecr.io/poc/docker-compose:20231105.5
docker push myacr.azurecr.io/poc/docker-compose:20231105.5

it pushes the image to the ACR.

@khamza85 khamza85 added the bug label Nov 5, 2023
@github-actions github-actions bot added Area: Release triage Area: ABTT Akvelon Build Tasks Team area of work Task: Bash labels Nov 5, 2023
@kirill-ivlev kirill-ivlev removed Area: ABTT Akvelon Build Tasks Team area of work Task: Bash labels Dec 8, 2023
Copy link

github-actions bot commented Jun 5, 2024

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants