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

Unable to use az confcom extention as it shows docker process was not found #156

Closed
cYKatherine opened this issue Jul 29, 2024 · 5 comments
Assignees
Labels
question Requiring some clarification

Comments

@cYKatherine
Copy link

cYKatherine commented Jul 29, 2024

Hello, I tried to use this action to run az confcom acipolicygen --debug --approve-wildcards -a test.json --print-policy in inlineScript but it showed warning cli.azext_confcom.custom: The docker process was not found. Please start Docker.

I tried to check if docker was started using systemctl | grep running but systemctl wasn't installed in the docker image (I assume?).

Also from this article: https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/ I saw that it is not recommended to run docker inside docker, so I'm wondering does that mean there is no Docker running in this github action? Does that mean I can't run az confcom with this action? Is there any way to bypass this issue?

Thank you so much!

@cYKatherine cYKatherine added the need-to-triage Requires investigation label Jul 29, 2024
@MoChilia MoChilia added question Requiring some clarification and removed need-to-triage Requires investigation labels Jul 29, 2024
@MoChilia
Copy link
Member

Hi @cYKatherine, as you mentioned, running docker inside docker is not recommended, so the azure/cli action does not support running docker commands inside. A current solution is to run these commands directly in bash. We may consider an enhancement to enable users to run Docker commands within azure/cli.

@MoChilia
Copy link
Member

Similar issue to #152.

@cYKatherine
Copy link
Author

Hello @MoChilia , thank you for getting back to me.

Can I confirm it is not possible to run az confcom using this azure/cli action?

A side question is: is there any way to run a specific az version on bash? From this comment you left last year it seems that it's not possible, has anything been upgraded between now and then?

Thank you so much!

@MoChilia
Copy link
Member

From the error message you provided, it appears that az confcom requires docker to start. Currently, this is not supported in the azure/cli action. Running a specific az version on bash can be a bit complex. You may refer to the downgrade scripts I have given in Azure/login#372 (comment).

@cYKatherine
Copy link
Author

Thank you @MoChilia I used the instruction here: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt and it worked.

For anyone who might also need this, this is how my workflow looks like:

     - name: uninstall azure-cli 
        run: |
          sudo apt-get remove -y azure-cli
      
      - name: install azure-cli 2.61.0
        run: |
          sudo apt-get update
          sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
          sudo mkdir -p /etc/apt/keyrings
          curl -sLS https://packages.microsoft.com/keys/microsoft.asc |
            gpg --dearmor | sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null
          sudo chmod go+r /etc/apt/keyrings/microsoft.gpg
          AZ_DIST=$(lsb_release -cs)
          echo "Types: deb
          URIs: https://packages.microsoft.com/repos/azure-cli/
          Suites: ${AZ_DIST}
          Components: main
          Architectures: $(dpkg --print-architecture)
          Signed-by: /etc/apt/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/azure-cli.sources
          sudo apt-get update
          sudo apt-get install azure-cli

          apt-cache policy azure-cli
          # Obtain the currently installed distribution
          AZ_DIST=$(lsb_release -cs)
          # Store an Azure CLI version of choice
          AZ_VER=2.61.0
          # Install a specific version
          sudo apt-get install azure-cli=${AZ_VER}-1~${AZ_DIST} --allow-downgrades

      - name: check azure-cli version
        run: |
          az --version

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

No branches or pull requests

2 participants