Hilscher Community Forum
Portainer Stack fails to pull from private Registry - Printable Version

+- Hilscher Community Forum (https://forum.hilscher.com)
+-- Forum: netPI 3 - Docker featuring Industrial Raspberry Pi 3 platform (https://forum.hilscher.com/forum-1.html)
+--- Forum: Software (https://forum.hilscher.com/forum-5.html)
+--- Thread: Portainer Stack fails to pull from private Registry (/thread-793.html)



Portainer Stack fails to pull from private Registry - Andi - December-15th-2021

Hallo everyone,

until now, we always used the "container"-Tab of Portainer to create containers from images, located on our own private registry. We never had problems pulling these images automatically while container-creation. At the moment we are trying to use the Portainer "Stack" feature to automate container creation, which is a way of using docker-compose via portainer.

Everything works fine, as long as we use images from docker-hub. If we try to pull images from our own private registry via stack, the attached error message gets displayed. If we pull these images beforehands via the "image"-Tab, the stack starts up well. We testet the same on a raspberry-pi with a newer portainer-version (2.11.0) without any problems.

Does anyone know a way to fix this problem? I also attached the example docker-compose-file to reproduce the problem.

thanks,

Andi



RE: Portainer Stack fails to pull from private Registry - Armin@netPI - December-15th-2021

What happens if you pull from your private registry without using the swarm option ... I mean manually using the "images" menu with "pull image" option?

Have you defined your registry in the "Registries" menu in portainer?

Thx
Armin


RE: Portainer Stack fails to pull from private Registry - Armin@netPI - December-15th-2021

I found the following article https://www.baeldung.com/linux/docker-compose-private-repositories. The conclusion of this article is that using docker-compose as done with "stacks" in portainer needs to login to the private registry first using the "docker login" command ... but this command I think isn't called by portainer before docker-compose is called during stacks execution. This is an assumption only. I have never verified it.

I read the latest portainer documentation ... https://docs.portainer.io/v/ce-2.11/user/docker/stacks/add ... I cannot recognize any hint on that page that a newer version of portainer would solve this problem. Can't see any login credentials either on this page.

Thx
Armin


RE: Portainer Stack fails to pull from private Registry - Andi - December-20th-2021

Hey Armin,

thanks for your quick reply.

Pulling the image from the "Images"-Tab works just fine. I defined the Registry at the Registries-Tab as always like this:

[attachment=539]

As I said, doing the same steps on a raspberry-pi with docker and portainer in the current version (2.11.0) works like a charm. To be sure, that any previouse "docker login ..." done on the raspberry-pi does not interact, I've just redone the test with a "docker logout ..." done before. I was still able to set up a stack in Portainer without having the images locally available and pulling them from the private registry during the stacks "deployment".

I have found a bug report, which implies that it should work and works from Version 2.1.0 onwards:

https://github.com/portainer/portainer/issues/4807

With this fix:

https://github.com/portainer/portainer/pull/4820

Regards,
Andi