How to retrieve a trained model docker image deployed to ACI?

Viewed 206

I've trained a model and deployed it to ACI using Azure ML studio. It works as expected. Now I want to download the docker image and use it in my local environment. Is it possible to download the image using CLI?

2 Answers

Azure ML Studio must have pushed a container image somewhere before spinning up a container instance on ACI. You might be able to find out the image name by using Docker's ACI integration. For instance, you could run...

$ docker login azure

$ docker context create aci myacicontext

$ docker ps

... and check the IMAGE value of your running container, and see if you can pull that image to your local machine. If not, you might be able to create a new one using docker commit.

Now I want to download the docker image and use it in my local environment. Is it possible to download the image using CLI?

It's possible to download the Docker image via CLI. When you trained a model and deployed it to ACI using Azure ML studio, there must be a place to store the images. Private registry or the public registry. You can see the tutorial, you can use a private registry such as the ACR, or other private registries. You can also use the Azure Machine Learning base images stored in the Microsoft registry, it's similar to the Docker hub.

If you have known where is the docker images stored, then you can download the docker images to your local environment.

From the public registry such as the Docker hub, you can pull the images directly:

docker pull image:tag

If it's a private registry, you need to log in with the credential first, for example, you use the Azure Container Registry:

docker login myacr.azurecr.io -u username -p password
docker pull myacr.azurecr.io/image:tag

Of course, you need to install the Docker server in your local environment first.

Related