Push to Docker registry hosted on Subpath
See original GitHub issueEnvironment:
- Jib version: 2.2.0
- Build tool: Maven
- OS: MacOs
Description of the issue: Docker registry is hosted on subpath at example.com/myRegistry. So, the image would be example.com/myRegistry/myDockerImage. Jib seems to take example.com as the image registry URL.
Expected behavior: example.com/myRegistry to be taken as image URL.
Steps to reproduce:
- set
to.image
to example.com/myRegistry/myDockerImage
Log output: [INFO] Containerizing application to plms.tgrc.tesco.org/registry/configserver… [WARNING] Base image ‘azul/zulu-openjdk:8u232’ does not use a specific image digest - build may not be reproducible [INFO] Using credentials from <to><auth> for plms.tgrc.tesco.org/registry/configserver [WARNING] Cannot verify server at https://plms.tgrc.tesco.org/v2/. Attempting again with no TLS verification. [INFO] The base image requires auth. Trying again for azul/zulu-openjdk:8u232… [INFO] Executing tasks: [INFO] [====== ] 18.5% complete [INFO] > pulling base image manifest [INFO] > building dependencies layer [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.436 s [INFO] Finished at: 2020-05-14T20:27:13+05:30 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.2.0:build (default-cli) on project config-server: Tried to retrieve authentication method for plms.tgrc.tesco.org but failed because: registry returned error code 404; possible causes include invalid or wrong reference. Actual error output follows: [ERROR] default backend - 404 [ERROR] | If this is a bug, please file an issue at https://github.com/GoogleContainerTools/jib/issues/new: 404 Not Found [ERROR] default backend - 404 [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top GitHub Comments
You mean
GET /myRegistry/v2/
, notGET /v2/
. (The registry server host is alwaysexample.com
.)I can now understand the technical reason (your reverse proxy setting) that your Docker Registry API endpoint is served at
/myRegistry/v2/
instead of/v2/
. Unfortunately, this is unconventional and does not conform to the Docker Registry API specification as I mentioned earlier. The API endpoint should beGET /v2/
, notGET /myRegistry/v2/
. The Docker image name has a well-established convention thatexample.com
is the registry host and that everything follows after the first slash (/
) refers to an image repository on the registry (which can have a nested hierarchy). For example, if the image name isexample.com/account/namespace/repository
, should a Docker client try every possible path such as/v2/
,/account/v2/
, and/account/namespace/v2/
?For example, this is the very reason that Sonatype Nexus assigns separate ports for its hosted Docker registries that are different from the main Nexus repository port.
Not sure why I didn’t reopen this issue. Will have this open as a feature request.