Azure / cli

Automate your GitHub workflows using Azure CLI scripts
MIT License
133 stars 54 forks source link

Add docker.sock mapping for linux agents #152

Open plotzwi-eq opened 5 months ago

plotzwi-eq commented 5 months ago

Currently it's not possible to fully utilize az acr commands, because the action is running inside container. Adding docker socket mapping could solve this. For now for example I can't use az acr login command. I know I can use it with --expose-token, export it to variable and login with docker action, but it seems more like a workaround than an actual solution.

MoChilia commented 5 months ago

Hi @plotzwi-eq, you're right, running az acr login in azure/cli is limited, because it requires calling the Docker CLI. But mapping the Docker socket inside a container is not recommended due to potential security risks (see https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/ for more information).

Instead, you can consider using the GitHub action for ACR login available at https://github.com/Azure/docker-login.