0

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.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
krishna bh
  • 81
  • 2
  • 9
  • The error means which you run the script does not install the Docker server. I suggest you can associate a vm with Docker installed to run the runbook. – Charles Xu Mar 12 '19 at 09:26

1 Answers1

0

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.

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
  • Can we intigrate ACR Task with Private server Repository (Like Github Enterprise version) – krishna bh Mar 22 '19 at 13:00
  • `az acr task create -t hello-world:{{.Run.ID}} -n hello-world -r MyRegistry -c https://github.com/Azure-Samples/acr-build-helloworld-node.git -f Dockerfile --git-access-token 0000000000000000000000000000000000000000` found this. https://learn.microsoft.com/en-us/cli/azure/acr/task?view=azure-cli-latest#examples – 4c74356b41 Mar 22 '19 at 13:22
  • In placce of Myregistry if i am giving https://github.com/* is working fine. Is there any way where i can use selft hosted github server URL replacing github url. – krishna bh Mar 25 '19 at 09:24