withRegistry in scripted pipeline (docker push)?

I need to push docker images to an internal registry where I need to provide username/password.

I have found this for declarative pipeline

Is there something similar I can do with scripted pipelines.

I am already using withCredentials and have a username/password credential for logging in to the registry. But I need some way of using this when doing a docker push using buildx.

1 Like

Hi, a bit late but maybe someone will bump into this like I did. I was looking for the same answer. And i found it. On the page you referenced, there’s a small link below each example with the text “Toggle Scripted Pipeline (Advanced)”. Clicking that will expand another example, in “scripted” syntax.

1 Like

Thanks a lot for your feedback @wbloos and welcome to this forum by the way.