Joxit/docker-registry-ui

[Feature] Quick Link for docker pull

onizet opened this issue ยท 11 comments

Hi,

Following your remarks when I've submitted my PR, you asked me about improvements.
One feature I really appreciate in other registry frontend, is the generated link "docker pull registry/image:tag" which avoid me to type the long command myself.

But it will be very more helpful if you can add the @sha256.
For keeping the UI as light as now, you can just add a "copy to clipboard" icon.

What do you think?

Joxit commented

Hi,
Thank you again for your feedback! :)
Yes, these are a good ideas ! I will try to add this feature! Thanks again ๐Ÿ˜‰
That's right, sha256 should be great sometimes. I will add a short sha256 (8 or 12 char)
Copy to clipboard should be also good

Joxit commented

Does this type of UI seem correct to you?
One icon for copy to clipboard and the display of the sha256 when we hover the tag.

docker-registry-ui-copy-to-clipboard-and-sha256

Wow you have been very quick :-) this is very nice and looks very good.
Does the copy to clipboard include the sha? Btw, good idea to have shorten the sha because yes, we only read the beginning :-)

Joxit commented

Hey hey, thx. Only copy to clipboard is ready, sha256 need some rework.

Nope, copy to clopboard copy this docker pull your.registry.com/your/image:tag
But maybe I should copy only your.registry.com/your/image:tag and not the docker pull command ? (to be used with the docker push or docker pull).

Code is here

I will say (but this is only my opinion), to keep the docker pull. The push is more likely used from continuous build or any other automated system.

Hello,
Thank you for your commit. I did some test and found an error.
When I click on the "copy to clipboard" icon, I get this: docker pull [**REGISTRY_TITLE**]/image:tag

Is it possible to have a second icon or a toggle button to copy also the sha256 inside the command? This is useful for production environment, where Trusted Content is turned on.

Joxit commented

Hi,
Thanks, so that mean URL is not used and you use REGISTRY_URL instead right ?
Hum... I will use the base URL of the UI when URL is not defined instead of REGISTRY_TITLE.

Hum... Or it can be a feature only for static docker-registry-ui with a specific env var ? So for these registries there will always be the sha256.

I noticed something, to pull with trusted content, it needs the sha256 of the digest and not the sha256 of the image. The one I get is the sha256 of the image... :/

Indeed, I'm using the static image, with both REGISTRY_TITLE and REGISTRY_URL defined (like in my PR for the documentation).

Oh this is quite disappointing for the digest. I weren't aware about that :-(

I found that you have to use a http header when requesting the image:
https://github.com/docker/distribution/blob/c8d8e7e357a1e5cf39aec1cfd4b3aef82414b3fc/docs/spec/manifest-v2-2.md

Joxit commented

Okay, registry URL is now fixed.

Question: Have you ever tried the trusted pull ? When you use it, is the tag of your image updated?
When I tried it, the tag was not taken into account.
Example :

$ docker pull alpine:latest@sha256:e1871801d30885a610511c867de0d6baca7ed4e6a2573d506bbec7fd3b03873f 
sha256:e1871801d30885a610511c867de0d6baca7ed4e6a2573d506bbec7fd3b03873f: Pulling from library/alpine
ff3a5c916c92: Already exists 
Digest: sha256:e1871801d30885a610511c867de0d6baca7ed4e6a2573d506bbec7fd3b03873f
Status: Downloaded newer image for alpine@sha256:e1871801d30885a610511c867de0d6baca7ed4e6a2573d506bbec7fd3b03873f
$ docker images --digests | grep alpine
REPOSITORY                                               TAG                 DIGEST                                                                    IMAGE ID            CREATED             SIZE
alpine                                                   <none>              sha256:e1871801d30885a610511c867de0d6baca7ed4e6a2573d506bbec7fd3b03873f   3fd9065eaf02        5 months ago        4.15MB

In my example, I pulled alpine:latest with digest but TAG is still <none>

Thx for the link, I will read this a bit later.

Well to be honest, I did not yet enforce the Content trust but this is on my roadmap.
I did pull some images with the digest (bad network which corrupt my layers) and see the "none" tag as you. The same behavior happens with Docker Swarm when you use the docker stack.

I know there are many issues still open in Docker here and here but it's a matter of time before a fix ๐Ÿคž .

Joxit commented

Ok, I leave this issue open the time that docker solve the problem :)