Blog Post

Azure Tools Blog
2 MIN READ

Azure CLI docker container base Linux image is now Azure Linux

JeremyLi's avatar
JeremyLi
Icon for Microsoft rankMicrosoft
Sep 05, 2024

Starting from the version 2.64.0 of Azure CLI, the base Linux distribution of Azure CLI is now Azure Linux.

 

Impact of the change

  • az commands are unaffected.
  • shell commands specific to Alpine will not be functional (ex: apk).
  • The following GitHub action will use the new image and could impact scripts using Alpine specific commands or components

Addressing the change in GitHub actions

If you are using GitHub actions, remove any Alpine-specific commands from the inlineScript in azure/cli action to achieve a smooth transition to this new image.

 

Known issues with workaround

We have identified the following issues that may impact your pipelines or scripts:

 

  1. Package missing

ICU package: Issue #29828 · Azure/azure-cli (github.com)

Jq: Issue #29830 · Azure/azure-cli (github.com)

 

Solution:

a. Pin azure/cli action to 2.63.0

 

- name: Azure CLI script
  uses: azure/cli@v2
  with:
    azcliversion: 2.63.0
    inlineScript: |
       <Your az commands here>

 

 

b. Install package manually: tdnf install -y icutdnf install –y jq

 

- name: Azure CLI script
  uses: azure/cli@v2
  with:
     azcliversion: 2.64.0
     inlineScript: |
        tdnf install -y icu
        tdnf install –y jq
        <Your az commands here>

 

 

  1. tdnf not working in GitHub Actions: `tdnf` not working in GitHub Actions · Issue #29835 · Azure/azure-cli

A sample of affected use case:

 

jobs:
   test:
      runs-on: ubuntu-latest
      container: mcr.microsoft.com/azure-cli
      steps:
      - name: test
        run: |
           tdnf install -y zip

 

 

Solution:

a. Use azure/cli action

 

    - name: Azure CLI script
      uses: azure/cli@v2
      with:
        azcliversion: 2.64.0
        inlineScript: |
          tdnf install -y zip
          <Your Azure CLI commands here>

 

 

b. Set GNUPGHOME to /root/.gnupg

jobs:
  test:
     runs-on: ubuntu-latest
     container: 
       image: mcr.microsoft.com/azure-cli
       env:
          GNUPGHOME: /root/.gnupg
     steps:
     - name: test
       run: |
          tdnf install -y zip
          <Your Azure CLI commands here>

 

 

Thank you for your cooperation!

If you are not yet prepared to migrate to Azure Linux due to some specific issues, please open an issue on GitHub by clicking the below links, so we can assist you.

Open a Azure CLI issue

Open a Azure CLI action issue

 

Updated Sep 06, 2024
Version 11.0
  • HardikMishra's avatar
    HardikMishra
    Copper Contributor

    I am trying to install docker using `tdnf install -y docker` in one of the pipeline step but I get below error.

    Refreshing metadata for: 'CBL-Mariner Official Base 2.0 x86_64'
    Refreshing metadata for: 'CBL-Mariner Official Microsoft 2.0 x86_64'
    Refreshing metadata for: 'CBL-Mariner Official Extras 2.0 x86_64'
    docker package not found or not installed

    How do we get docker to be installed.  My pipeline needs to build docker image and we are using  `azure-cli:2.64.0`