-
Bug
-
Resolution: Unresolved
-
Blocker
When using the docker-workflow plugin with the latest version of podman you cannot login. Podman no longer accepts a URL as the login argument.
Old podman :
sh-4.4$ podman version 3.2.3
sh-4.4$ podman login -u maxa -p $PASSWORD https://registry-1.docker.io
Login Succeeded!
sh-4.4$ podman login -u maxa -p $PASSWORD registry-1.docker.io
Login Succeeded!
New podman :
sh-4.4$ podman --version
podman version 3.3.1
sh-4.4$ podman login -u maxa -p $PASSWORD https://registry-1.docker.io
Error: credentials key has https[s]:// prefix
sh-4.4$ podman login -u maxa -p $PASSWORD registry-1.docker.io
Login Succeeded!
If you try to use a servername only in Jenkins, the plugin is expecting a full URL and you get an error :
docker.withRegistry("registry-1.docker.io", docker_registry_credential)
hudson.remoting.ProxyException: java.net.MalformedURLException: no protocol: registry-1.docker.io
at java.base/java.net.URL.<init>(URL.java:645)
at java.base/java.net.URL.<init>(URL.java:541)
at java.base/java.net.URL.<init>(URL.java:488)
at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.getEffectiveUrl(DockerRegistryEndpoint.java:144)
at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:299)
at org.jenkinsci.plugins.docker.workflow.RegistryEndpointStep$Execution2.newKeyMaterialFactory(RegistryEndpointStep.java:95)
at org.jenkinsci.plugins.docker.workflow.AbstractEndpointStepExecution2.doStart(AbstractEndpointStepExecution2.java:52)
at org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:77)
If you run the same command with https:// on the servername, podman throws the "Error: credentials key has https[s]:// prefix" message.
You might want to fix this now before docker decide to follow the same rules on docker login and require only a servername not a full URL. (they might not, but can you imagine the panic if they do?)
The fix should probably allow with/without protocol, otherwise is a breaking change.
I ran into the same issue today. Glad to see it is already so well documented here. I looked into the docker-commons plugin code because that's where the exception is thrown but I don't see a fix simple enough for me to implement myself.