How to send a Portainer Webhook to recreate a container

Viewed 212

I use Portainer v2.13.1. With a private secured Docker Registry. After activating the Container webhook in Portainer, I do a POST Request to generated URL.

enter image description here

But this fails with

{
    "message": "Error updating service",
    "details": "Error response from daemon: Head \"https://registry.mydomain/v2/my-gateway/manifests/1.0.3-RELEASE\": no basic auth credentials"
}

I added a Basic Auth in Postman to the request with my docker registry credentials. But this also not worked.

How I must build the request to make this work?

2 Answers

2.14 fixes it.

It's actually because of the way the header was being used in the docker proxy.

In 2.13 you're meant to pass a portainer registryId in the x-registry-auth, and not the docker credentials. I bet few have seen this little gem in the documentation.

https://github.com/portainer/portainer/blob/develop/api/api-description.md#private-registry

It's because we were kind of overriding the standard header. But we've sorted that now so it'll take either option.

Fix applied here: https://github.com/portainer/portainer/pull/7037

Related