question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Push to Docker registry hosted on Subpath

See original GitHub issue

Environment:

  • 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:

  1. 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:open
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
chanseokohcommented, Sep 28, 2021

GET /v2/ gives {} empty response.

You mean GET /myRegistry/v2/, not GET /v2/. (The registry server host is always example.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 be GET /v2/, not GET /myRegistry/v2/. The Docker image name has a well-established convention that example.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 is example.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.

The docker client does not allow a context as part of the path to a registry, as the namespace and image name are embedded in the URLs it uses. This is why requests to repositories on the repository manager are served on a specific and separate port from the rest of the application instead of how most other repositories serve content via a path i.e. <nexus-hostname>/<repositoryName>/<path to content> .

0reactions
chanseokohcommented, Nov 30, 2021

Not sure why I didn’t reopen this issue. Will have this open as a feature request.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I push to a Docker registry mount on a subpath?
If I have a registry mounted at https://x.y.z.com/registry, how must I tag my images? Docker seems to insist on prepending v2/ to any...
Read more >
Configuring a registry - Docker Documentation
The proxy structure allows a registry to be configured as a pull-through cache to Docker Hub. See mirror for more information. Pushing to...
Read more >
How to push docker images into a private registry with a full ...
I don't think it is possible at the moment. But you always can open a feature request on the github repository: ...
Read more >
How to implement a simple personal/private Linux container ...
To push to the registry, use podman tag to first tag the image and the registry location, and then push the image. Example:...
Read more >
How To Set Up a Private Docker Registry on Ubuntu 20.04
Docker also has a free public registry, Docker Hub, that can host ... be able to push a custom Docker image to your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found