brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: a portainer stack webhook can switch the image tag with ?tag= or skip the pull

Portainer
~/tips/tip-portainer-stack-webhook-tag-pullimage

curl -X POST "https://portainer.example.com:9443/api/stacks/webhooks/638e6967-ef77-4906-8af8-236800621360?tag=1.2.0"

Lets a registry or CI job redeploy a Portainer stack, optionally with another image tag.

A stack webhook is more than a redeploy button. Query parameters let the caller steer what gets deployed.

curl -X POST "https://portainer.example.com:9443/api/stacks/webhooks/638e6967-ef77-4906-8af8-236800621360?tag=1.2.0"
curl -X POST "https://portainer.example.com:9443/api/stacks/webhooks/638e6967-ef77-4906-8af8-236800621360?pullimage=false"

Turn on Create a stack webhook in the stack editor to get the URL. A POST redeploys the stack with the latest image of the same tag, ?tag= deploys another tag, and pullimage=false redeploys without pulling images first.

Stack webhooks and the pullimage option are both Portainer Business Edition features. The call returns before the deployment is done, and the URL is the only secret, so treat it like a password.

Further reading: Portainer docs: Stack webhooks

More Portainer tips Choose Polling in a Portainer GitOps update when your Git host can't reach Portainer Put Portainer environments in groups and give users access to a whole group Portainer's Edge Agent checks in every 5 seconds, and you can change that docker run -d -p 9001:9001 --name portainer_agent --restart=always \ Deploy the container → Replace All Portainer tips (28) All topics

Link