Kaniko fails to push to GitLab Container Registry as it omits the port though it is included in tag
We are running gitlab/gitlab-ee:13.1.2-ee with GitLab Container Registry enabled.
We’ve set up a pipeline which uses Kaniko for building images.
The image is built successfully but not pushed to the registry as the port is missing as it seems.
As GitLab is running behind an NGINX reverse proxy we see status code 405.
We are really puzzled about this issue, as the Docker documentation clearly says:
To do this, tag the image with the host name or IP address, and the port of the registry
This is what the job log shows:
$ export ... export CI_PROJECT_DIR='/builds/MYGROUP/MYPROJECT' ... export CI_REGISTRY_IMAGE='service.MYDOMAIN.de:5050/MYGROUP/MYPROJECT' ... $ /kaniko/executor --context $CI_PROJECT_DIR/MYDIRECTORY --dockerfile $CI_PROJECT_DIR/MYDIRECTORY/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG INFO Resolved base name mcr.microsoft.com/dotnet/core/aspnet:3.1 to runtime ... INFO ENTRYPOINT ["dotnet", "MYSERVICE.dll"] error pushing image: failed to push to destination service.MYDOMAIN.de:5050/MYGROUP/MYPROJECT:: PATCH https://service.MYDOMAIN.de/v2/MYGROUP/MYPROJECT/blobs/uploads/ffffffff-ffff-ffff-ffff-ffffffffffff?_state=REDACTED: unsupported status code 405 405; body: <html> <head><title>405 Not Allowed</title></head> <body bgcolor="white"> <center><h1>405 Not Allowed</h1></center> <hr><center>nginx/1.10.3 (Ubuntu)</center> </body> </html> ERROR: Job failed: exit code 1
As one can see the port is even shown in the error message, but missing in the PATCH request itself.
Does anybody know how to solve this?
Thanks in advance!