Azure runbook for docker container

2019-08-28 15:38发布

问题:

writing azure runbook for pushing docker image to acr. When i am running script i am getting error docker is not recognized as internal or external command.

Simplified runbook as below.

Import-Module hosts
Import-Module docker
Invoke-dockercommand -v
docker -v

When i run above nunbook i am getting below error.

Docker.exe : The term 'Docker.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.At C:\Modules\User\Docker\Docker.psm1:41 char:5

Any Suggestion please.

Thanks in Advacne

回答1:

Azure Automation doesnt support building docker images, so there is no docker on the runbook workers. You can use hybrid workers (so your own agents) and install docker on those.

There are other (possibly better ways) of doing this. Like Azure Container Registry build tasks or CI\CD pipelines.