Azure / acr-builder

Azure Container Registry Build Runner
MIT License
38 stars 35 forks source link

Image aliases (acr or bash) not available for az acr run --platform windows #634

Open mloskot opened 2 years ago

mloskot commented 2 years ago

The images aliases documented here are not available when running a task with --platform windows:

image

To Reproduce

bash not available

# HelloWorld.yaml
version: v1.1.0
steps:
  - cmd: bash echo "Running {{.Run.TaskName}} task {{.Run.ID}} on {{.Run.OS}} {{.Run.Architecture}}"
>  az acr run --registry mycr --platform windows --file .\HelloWorld.yaml .
Packing source code into tar to upload...
Uploading archived source code from 'C:\Users\mateuszl\AppData\Local\Temp\cli_source_archive_3feaa7daa5b941158615bf49b1d6af03.tar.gz'...
Sending context (1.832 KiB) to registry: mycr...
Queued a run with ID: db3d
Waiting for an agent...
2022/08/08 19:39:30 Downloading source code...
2022/08/08 19:39:35 Finished downloading source code
2022/08/08 19:39:37 Alias support enabled for version >= 1.1.0, please see https://aka.ms/acr/tasks/task-aliases for more information.
2022/08/08 19:39:38 Creating Docker network: acb_default_network, driver: 'nat'
2022/08/08 19:39:38 Successfully set up Docker network: acb_default_network
2022/08/08 19:39:38 Setting up Docker configuration...
2022/08/08 19:39:48 Successfully set up Docker configuration
2022/08/08 19:39:48 Logging in to registry: mycr.azurecr.io
2022/08/08 19:39:52 Successfully logged into mycr.azurecr.io
2022/08/08 19:39:52 Executing step ID: acb_step_0. Timeout(sec): 600, Working directory: '', Network: 'acb_default_network'
2022/08/08 19:39:52 Launching container with name: acb_step_0
Unable to find image 'bash:latest' locally
latest: Pulling from library/bash
ab6db1bc80d0: Pulling fs layer
a4fcbab32bb6: Pulling fs layer
00bf0ebb3446: Pulling fs layer
00bf0ebb3446: Verifying Checksum
00bf0ebb3446: Download complete
a4fcbab32bb6: Verifying Checksum
a4fcbab32bb6: Download complete
ab6db1bc80d0: Download complete
ab6db1bc80d0: Pull complete
a4fcbab32bb6: Pull complete
00bf0ebb3446: Pull complete
Digest: sha256:c5c2c08887c018533b1f04a79521fd7466c61f14f23d302b2de5a49caedc8f63
Status: Downloaded newer image for bash:latest
docker: Error response from daemon: the working directory 'c:\workspace' is invalid, it needs to be an absolute path.
See 'docker run --help'.
2022/08/08 19:39:57 Container failed during run: acb_step_0. No retries remaining.
failed to run step ID: acb_step_0: exit status 1

Run ID: db3d failed after 29s. Error: failed during run, err: exit status 1
Run failed

acr not available

# HelloWorld.yaml
version: v1.1.0
steps:
  - cmd: acr tag list --registry {{.Run.Registry}} --repository hello-world
>  az acr run --registry mycr --platform windows --file .\HelloWorld.yaml .
Packing source code into tar to upload...
Uploading archived source code from 'C:\Users\mateuszl\AppData\Local\Temp\cli_source_archive_cf0750ff71964c3c902597d7053d673d.tar.gz'...
Sending context (1.779 KiB) to registry: mycr...
Queued a run with ID: db3c
Waiting for an agent...
2022/08/08 15:37:51 Downloading source code...
2022/08/08 15:37:58 Finished downloading source code
2022/08/08 15:38:00 Alias support enabled for version >= 1.1.0, please see https://aka.ms/acr/tasks/task-aliases for more information.
2022/08/08 15:38:00 Creating Docker network: acb_default_network, driver: 'nat'
2022/08/08 15:38:01 Successfully set up Docker network: acb_default_network
2022/08/08 15:38:01 Setting up Docker configuration...
2022/08/08 15:38:11 Successfully set up Docker configuration
2022/08/08 15:38:11 Logging in to registry: mycr.azurecr.io
2022/08/08 15:38:15 Successfully logged into mycr.azurecr.io
2022/08/08 15:38:15 Executing step ID: acb_step_0. Timeout(sec): 600, Working directory: '', Network: 'acb_default_network'
2022/08/08 15:38:15 Launching container with name: acb_step_0
Unable to find image 'acr:latest' locally
docker: Error response from daemon: pull access denied for acr, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
2022/08/08 15:38:19 Container failed during run: acb_step_0. No retries remaining.
failed to run step ID: acb_step_0: exit status 1

Run ID: db3c failed after 31s. Error: failed during run, err: exit status 1
Run failed

Expected behavior

The bash echo'ing the expected output. The acr tag list listing available tags. Both, without failure.

Any relevant environment information

>  az version
{
  "azure-cli": "2.39.0",
  "azure-cli-core": "2.39.0",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {
    "account": "0.2.3"
  }
}
>  $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Microsoft Windows 10.0.19044
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
northtyphoon commented 1 year ago

It's acr tasks issue. Please reopen the issue in https://github.com/azure/acr-builder/issues. Thanks.