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 container webhook recreates one container when the registry gets a push

Portainer
~/tips/tip-portainer-container-webhook-recreate

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

Redeploys a single Portainer-managed container with a fresh image when something calls its URL.

For a single container that is not part of a stack, a stack webhook does not apply. Containers have their own.

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

Open the container, switch on Container webhook in the details screen and copy the link. A POST recreates the container with the latest image of the same tag, and ?tag= swaps to another tag. In Docker Hub you can point a repository webhook at the same URL.

This is a Portainer Business Edition feature, and it does not exist on Edge Agent environments, because the tunnel is only opened on demand.

Further reading: Portainer docs: Container 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