Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
706 views
in Technique[技术] by (71.8m points)

azure - How can I import a container to ACR and configure it to be a linux platform container?

When building my docker image locally and import it to Azure Container Registry (ACR), the Image platform is Windows. It should be Linux. How can I import my image as a Linux platform?

I am using this command to import the image to my ACR.

az acr import
question from:https://stackoverflow.com/questions/66052219/how-can-i-import-a-container-to-acr-and-configure-it-to-be-a-linux-platform-cont

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

By using the command az acr import means that you can import an image to an Azure Container Registry from another Container Registry. So you should have container images from a public registry or another Azure container registry, in the same or a different Azure subscription or tenant or from a non-Azure private container registry. Read Import container images to a container registry for more details.

In this case, if you have built the images locally, you can push the images directly to the ACR instead of using import. You can make it as the Tutorial: Create an Azure container registry and push a container image:

log in to your Azure Container Registry instance

az acr login --name <acrName> 

tag the image with the full name of the registry's login server.

docker tag <localImage> <acrLoginServer>/<acrRepository>:<tag>

Push image to Azure Container Registry

docker push <acrLoginServer>/<acrRepository>:<tag>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...