Home > Software design >  How to create azure acr task without providing git repository?
How to create azure acr task without providing git repository?

Time:09-13

I was able to create a azure acr task using the below command:

az acr task create --registry myregistry \
           --name demo_task \
                   --image demo_app:{{.Run.ID}} \
                   --file demo.Dockerfile \
                   --context https://github.com/hm-group/repo.git#branch \
                   --git-access-token your_token --debug

But, I don't want to provide git repository. Just want to use --file and tried build this task using below command:

az acr task create --registry productionai \
           --name demo_task \
                   --image demo_app:{{.Run.ID}} \
                   --file demo.Dockerfile 

Error:

If the task is not a System Task, --context-path must be provided.

CodePudding user response:

We can provide --context as /dev/null if we want to use only file without providing context.

Command:

az acr task create --registry myregistry \
                   --name demo_task \
                   --image demo_app:{{.Run.ID}} \
                   --file demo.Dockerfile \
                   --context /dev/null
  • Related