KASMI G.
KASMI G.

Reputation: 116

Pushing custome images to Azure ACR fails " Use of closed network connection "

While learning how to use Azure Container Registry with the official tutorial : https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal?tabs=azure-cli

I tried to push images to my registry, the Hello World image in the course works fine, but when i try to use my own images it fails. It also fails when i pull images from docker and try to push them to my Azure registry.

Nginx image failed push

Of course, the images are correctly tagged and the CLI connection works fine.

i'm also following another Azure course in which i build the image with Github actions ( https://learn.microsoft.com/en-us/azure/aks/kubernetes-action ), it also works great on the repo of this course, but once i try with my own projects, it fails. This time the error is about the url / the credentials :

Github action error

After investigations, i'm sure that the credentials are correct, but the URL is maybe false because it never create it. That's why i was trying to push it manually in the first place.

EDIT : I managed to make it work by changing the wifi source i used, but i still don't understand how is this possible, why it doesn't work on github actions and what should i change in my conf to make it work with the original wifi again.

Upvotes: 1

Views: 1210

Answers (2)

FloCAD
FloCAD

Reputation: 185

I met the exact same issue and didn't understood why. Then I just logout from my VPN and it works. Ain't got any explanations about this but I hope it could help people which are stuck.

Upvotes: 1

Komali Annem
Komali Annem

Reputation: 753

I tried to reproduce the same issue in my environment and got the below output

I have created the docker file and write the some script

vi dockerfile

FROM httpd:2.4
COPY ./public-html/ /usr/local/apache2/htdocs/

I have build the docker file using below command

docker build -t my-apache2 .

enter image description here

I have run the Image id using the below command

docker run -d -p 80:80 image_id

enter image description here

Created the container registry

enter image description here

After creating the registry we should enable the Access key if not we will not able to fetch the image to container instances

enter image description here

I have logged into the registry server

docker login login_server
Username:XXXX
password:XXXXX

enter image description here

After succeeded I have pushed the image into the container registry I have tagged the image and pushed into the registry

docker tag image_name login_server/image_name
docker push login_server/image_name

Here we can find the image in repositories which we have pushed

enter image description here

I have created the container instance, while creating we have to give the Image resource as container registry then only we will get the pushed image

enter image description here

Upvotes: 1

Related Questions