Reputation: 5236
I have created an Azure Container Registry and put a windows docker image in it.
I have also created a Windows server with containers VM in Azure.
Both the VM and the ACR are in the same resource group.
I would simply like to run the container in the VM. Seems like a simple issue but I am really struggling.
So I RDP into the VM. Indeed docker is there. How to I, from Powershell in the VM, run my container from the ACR? Cannot seem to find any tutorial or documentation on this, for what should be an extremely simple and straightforward task. All the examples I have found running Azure containers use the Azure CLI which is not avialable in the VM.
Upvotes: 2
Views: 1431
Reputation: 5236
Indeed this turned out to be so easy. What was confusing me is that the Azure cli is a management tool that is only used from a client, not inside a VM. Inside the VM you simply use docker commands.
The thing I was missing was a way to reference the Azure container registry. What is never made clear is that the acr is nothing more or less than a Docker container registry. The acr has a public URL that is visible in the Azure dashboard. So you simply use the docker login command from the VM to access the registry.
But what about the username and password for the acr? Aha. This is another Dr. Who secret handshake. You have to know to enable the admin account on the acr. (there are no user accounts apparently for the acr...just a single admin account. You might ask how you can be an admin if there are no users to admin. I leave this question to the philosophers) You do this through the dashboard. Then you can define a username and get a generated password that you can use in the VM to login to the container registry.
Then everything starts working. The docker run command in the VM pulls the image from the acr and runs it.
Upvotes: 2