one-click-apps
one-click-apps copied to clipboard
[Deployment Issue] Not possible to use custom registries on a Portainer one-click install.
Recently I became aware that using a custom registry for pulling images did not work on the Portainer one-click install.
Here's two pictures, the first one is on a CapRover one-click install, the other one is on a command line docker start.
The registry can be added to both, but when it comes time to actually pull an image, it is not possible to pull it.
The caprover log gives a cryptic JWT token error when fetching the image. Pictures attached.
Caprover one-click install

Portainer standalone

Caprover log

Has anyone else had this issue.
Looks similar to these issues:
- https://github.com/portainer/portainer/issues/3542
- https://github.com/portainer/portainer/issues/3192
- https://github.com/portainer/portainer/issues/4840
Portrainer deployed on CapRover is pretty basic... I don't understand why it is related to CapRover only https://github.com/caprover/one-click-apps/blob/7149329fd22a0fa1f452caa925ba050b5a55677b/public/v4/apps/portainer.yml#L3-L10
Well, I'm not saying it's related to CapRover only, I'm saying that I couldn't do it. I've used CapRover one-click apps for Redis/Postgres and a lot of other services and this is the first time that a one-click app has behaved differently that just launching it from the Docker cli.
I'll close the issue if it turns out I'm wrong, but I think I'm right.
You're probably correct if you tested it. But I am having difficulty understanding the potential reason behind it.
What is the exact docker run command that you use to set up portrainer?
docker volume create portainer_data
sudo docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
I had to sudo because otherwise /var/run/docker.sock wouldn't bind.
Try to replicate this with docker swarm:
docker service create \
--name my-test-portrainer \
--publish 8080:8000 \
--publish 9090:9000 \
--mount type=volume,source=portainer_data,destination=/data \
--mount type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock \
portainer/portainer-ce
Open your browser on port 9090. Does this work?
Don't mind the error, I didn't bother setting up the ENV... but I can see the image is being pulled every time a container fails to start so the connection is working with that swarm setup.
Then it is really a mystery. You can compare the two services by running inspect to see if there is any differences:
docker service inspect srv-captain--yourcaproverportrainer --pretty
docker service inspect your-docker-swarm-portrainer --pretty