Giter Site home page Giter Site logo

docker-registry-ui's Introduction

Docker Registry UI

Docker Registry UI

Version Stars Pulls

Have you ever wanted a visual website to show you the contents of your Docker Registry? Look no further. Now you can list your Images, Tags and info in style.

This project comes as a pre-built docker image capable of connecting to another registry.

Note: This project only works with Docker Registry v2.

Getting started

Creating a full Docker Registry Stack with this UI

By far the easiest way to get up and running. Refer to the example docker-compose.yml example file, put it on your Docker host and run:

docker-compose up -d

Then hit your server on http://127.0.0.1

If you have your own Docker Registry to connect to

Here's a docker-compose.yml for you:

version: "2"
services:
  app:
    image: jc21/registry-ui
    ports:
      - 80:80
    environment:
      - REGISTRY_HOST=your-registry-server.com:5000
      - REGISTRY_SSL=true
      - REGISTRY_DOMAIN=your-registry-server.com:5000
      - REGISTRY_STORAGE_DELETE_ENABLED=
      - REGISTRY_USER=
      - REGISTRY_PASS=
    restart: on-failure

If you are like most people and want your docker registry and your docker ui to co-exist on the same domain on the same port, please refer to the Nginx configuration used by the docker-registry-ui-proxy image as an example. Note that there are some tweaks in there that you will need to be able to push successfully.

Environment Variables

  • REGISTRY_HOST - Required: The registry hostname and optional port to connect to for API calls
  • REGISTRY_SSL - Optional: Specify true for this if the registry is accessed via HTTPS
  • REGISTRY_DOMAIN - Optional: This is the registry domain to display in the UI for example push/pull code
  • REGISTRY_STORAGE_DELETE_ENABLED - Optional: Specify true or 1 to enable deletion features, but see below first!
  • REGISTRY_USER - Optional: If your docker registry is behind basic auth, specify the username
  • REGISTRY_PASS - Optional: If your docker registry is behind basic auth, specify the password

Refer to the docker documentation for setting up native basic auth.

Deletion Support

Registry deletion support sux. It is disabled by default in this project on purpose because you need to accomplish extra steps to get it up and running, sort of.

Permit deleting on the Registry

This step is pretty simple and involves adding an environment variable to your Docker Registry Container when you start it up:

docker run -d -p 5000:5000 -e REGISTRY_STORAGE_DELETE_ENABLED=true --name my-registry registry:2

Enabling Deletions in the UI

Same as the Registry, just add the REGISTRY_STORAGE_DELETE_ENABLED=true environment variable to the registry-ui container. Note that true is the only acceptable value for this environment variable.

Cleaning up the Registry

When you delete an image from the registry this won't actually remove the blob layers as you might expect. For this reason you have to run this command on your docker registry host to perform garbage collection:

docker exec -it my-registry bin/registry garbage-collect /etc/docker/registry/config.yml

And if you wanted to make a cron job that runs every 30 mins:

0,30 * * * * /bin/docker exec -it my-registry bin/registry garbage-collect /etc/docker/registry/config.yml >> /dev/null 2>&1

Screenshots

Dashboard Image Pulling Pushing

TODO

  • Add pagination to Repositories, currently only 300 images will be fetched
  • Add support for token based registry authentication mechanisms

docker-registry-ui's People

Contributors

huapox avatar jamesdube avatar jc21 avatar xvmaatmat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-registry-ui's Issues

image detail page shown empty without any error

I've just deployed docker-registry-ui. I really like the simple way to deploy it and the lightweight UI. But at least for me, it's shown "very lightful" after clicking on an image-name. The front-page works fine showing my images very quick. The detail page only shows the pure layout but no body, content or error. Also browser console and network-debug tab shows no culprit.

The registry backend ist docker registry:2. Any idea what's wrong?

version: "3.7"

networks:
  default:
    external: true

volumes:
  cert-storage:
    name: php-stack-cert-storage
    driver: local
    driver_opts:
      type: none
      device: "$HOME/.local/share/mkcert"
      o: bind
  docker-registry-storage:
  docker-registry-config:

services:
  docker-registry:
    image: registry:2
    restart: on-failure
    hostname: registry-api.php-stack.docker
    ports:
      - "127.0.0.11:5000:5000/tcp"
    networks:
      - default
    environment:
      #REGISTRY_HTTP_ADDR: "0.0.0.0:5000"
      REGISTRY_HTTP_TLS_CERTIFICATE: "/certs/_wildcard.php-stack.docker.pem"
      REGISTRY_HTTP_TLS_KEY: "/certs/_wildcard.php-stack.docker-key.pem"
      REGISTRY_STORAGE_DELETE_ENABLED: true
    volumes:
      - "cert-storage:/certs"
      - "docker-registry-storage:/var/lib/registry"
      - "docker-registry-config:/etc/docker/registry"

  docker-registry-ui:
    image: jc21/registry-ui
    restart: on-failure
    depends_on:
      - docker-registry
    hostname: registry.php-stack.docker
    networks:
      - default
    environment:
      SUPPRESS_NO_CONFIG_WARNING: true
      REGISTRY_HOST: registry-api.php-stack.docker:5000
      REGISTRY_DOMAIN: registry-api.php-stack.docker:5000
      REGISTRY_SSL: true
      REGISTRY_STORAGE_DELETE_ENABLED: true
      #REGISTRY_USER:
      #REGISTRY_PASS:

Deploy on rancher using route path based

This is awesome project, I have used it on my own server and work perfectly using subdomain.
I have a question, how to deploy this project on a server with "route path based"? Such as domain.com/registries

Json parse exception

I'm getting the following exception when browsing any docker image:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

I've set NODE_ENV to development but there are no logs about it. Could you provide a hint on how to get the logs spilled out in order to track the issue?

Thanks in advance!

How about use golang as the backend?

First this is awesome project, with lite useful and refreshing frontend.

And now it's with node for the backtend, as we can see the image's size at 165.72 MB in dockerhub alter compressed. and the runtime mem up to about 40Mb.

There is just about 3 apis between backtend and frontend, so come with a idea of changing the backtend to golang of implement. for lite image size(about 40Mb) and lower run memory(about 8Mb).

show images labels in detailed view

Because more and more docker images are built from CI/CD tools, it could be really useful to view image labels in images tab.
The labels can provide critical data like source git hash, build date, etc... , ex :

            "Labels": {
                "org.label-schema.build-date": "2019-05-09T16:39:25Z",
                "org.label-schema.schema-version": "1.0",
                "org.label-schema.vcs-ref": "2103d7b6fac15ccf6df7ef9cd3661aa89ec94a0f",
                "org.label-schema.vcs-url": "https://git.xxx.fr/XXXXX/xxxxxx.git"
            }

registry with htpasswd not accessible

Hi, Is possible to use docker secrets to pass REGISTRY_PASS ?

I got "Internal Error There may be a problem communicating with the Registry" when accessing from browser. registry-ui container can telnet to registry normally on port 5000

Here is my compose file

version: "3.2"

services:
    registry:
        image: registry:2
        ports:
          - 5000:5000
        secrets:
          - registry.crt
          - registry.key
          - registry.htpasswd
        environment:
          - REGISTRY_HTTP_SECRET=my-http-secret
          - REGISTRY_AUTH=htpasswd
          - REGISTRY_AUTH_HTPASSWD_PATH=/run/secrets/registry.htpasswd
          - REGISTRY_AUTH_HTPASSWD_REALM=RegistryRealm
          - REGISTRY_HTTP_TLS_CERTIFICATE=/run/secrets/registry.crt
          - REGISTRY_HTTP_TLS_KEY=/run/secrets/registry.key
        deploy:
            placement:
                constraints:
                    - node.role == worker
            mode: replicated
            replicas: 1
    ui:
        image: jc21/registry-ui
        ports:
          - 10081:80
        secrets:
          - registry.password
        environment:
          - REGISTRY_SSL=true
          - REGISTRY_HOST=registry:5000
          - REGISTRY_STORAGE_DELETE_ENABLED=true
          - REGISTRY_USER=admin
          - REGISTRY_PASS=/run/secrets/registry.password
        deploy:
            placement:
                constraints:
                    - node.role == worker
            mode: replicated
            replicas: 1
            
secrets:
    registry.crt:
        external: true
    registry.key:
        external: true
    registry.htpasswd:
        external: true
    registry.password:
        external: true

registry last log

time="2019-12-21T02:42:10.6238993Z" level=info msg="listening on [::]:5000, tls" go.version=go1.11.2 instance.id=8e8aab69-6d4d-4003-ba9c-79fc72f0aee4 service=registry version=v2.7.1 

docker-registry-ui log when accesing from browser

[12/21/2019] [2:43:19 AM] [Express ] › ⚠  warning Error: getaddrinfo ENOTFOUND admin admin:443  at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:26)

Next release

Can we have a release with the fix for docker container names with dots in it?

Basic Auth Error

With the latest versión, when you use a registry that uses basic authentication, I receive the next error:
[4/19/2020] [8:03:15 PM] [Express ] › ⚠ warning Error: getaddrinfo ENOTFOUND USER User:443

For <registry_user> you see the real user name. After doing some research, right now the basic auth is doing by concatenating the user:pass inside the calling URL. Despite this could work, the restler parser is failing and takes the user as FQDN for the DNS.

My recommendation is to change how the options of restler are being generated and use the username and password parameters. Something like:

this.getUrlOptions = function (version) {
    let options = {
        headers: {
            'User-Agent': 'Docker Registry UI'
        },
        username = username,
        password = password
    };

    if (version === 2) {
        options.headers.Accept = 'application/vnd.docker.distribution.manifest.v2+json';
    }

    return options;
};

I tried to debug the solution but it fails with the table-ui so I cannot send you a pull request. Thanks!

arm64v8 image

I've created a arm64v8 image using multistage builds. Maybe you can add it in your Jenkins build and push it to the docker hub.

This is my docker build file:

FROM jc21/registry-ui as original

FROM arm64v8/node:alpine

RUN apk add --update --no-cache curl

ENV NODE_ENV=production

COPY --from=original /srv/app/dist                /srv/app/dist
COPY --from=original /srv/app/node_modules        /srv/app/node_modules
COPY --from=original /srv/app/LICENCE             /srv/app/LICENCE
COPY --from=original /srv/app/package.json        /srv/app/package.json
COPY --from=original /srv/app/src/backend         /srv/app/src/backend

WORKDIR /srv/app

CMD node --max_old_space_size=250 --abort_on_uncaught_exception src/backend/index.js

HEALTHCHECK --interval=15s --timeout=3s CMD curl -f http://localhost/ || exit 1

Can't assign PORT without breaking HEALTHCHECK

Love the simplicity here. Chosen this over Portus and others, as i prefer slim.

let port = process.env.PORT || 80;

If I assign PORT to something, i see that node listens on that port in the container, but the container's HEALTHCHECK fails as it's looking at PORT 80

HEALTHCHECK --interval=15s --timeout=3s CMD curl -f http://localhost/ || exit 1

Bug: Images with a / in the name do not work

An image of mine: home/homeassistant. This wont load because of the /.

I've looked trough the code but I'm not able to find the specific line which causes the error. It's a routing issue though.

Error connecting to registry over HTTP

I'm running this UI in Kubernetes 1.10 connecting to our private registry in the same cluster and getting the below error.

WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
2018-04-17T09:57:13.375Z - info: PID 6 listening on port 80 ...
2018-04-17T09:57:13.379Z - info: Registry Host: image-registry:5000
warn: Error: write EPROTO 139648476564296:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:825:
     at _errnoException (util.js:1031:13)
    at WriteWrap.afterWrite [as oncomplete] (net.js:873:14)
warn: Error: write EPROTO 139648476564296:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:825:
     at _errnoException (util.js:1031:13)
    at WriteWrap.afterWrite [as oncomplete] (net.js:873:14)

Our private registry is running with HTTP and I have successfully used this project to connect as a UI without issue https://github.com/snagles/docker-registry-manager

Below are the environment variables I'm using (excuse the Kubernetes syntax).

            containers:
            - name: image-registry-ui
              image: jc21/registry-ui
              env:
              - name: REGISTRY_HOST
                value: image-registry:5000
              - name: REGISTRY_SSL
                value: "false"
              - name: REGISTRY_STORAGE_DELETE_ENABLED
                value: "true"
              - name: REGISTRY_DOMAIN
                value: registry.example.com
              ports:
              - containerPort: 80
                name: http
                protocol: TCP

Error getaddrinfo EAI_AGAIN https https:80

Hello,

Running the following command :

docker run -e REGISTRY_HOST=https://docker.kube.unc.nc -p 8080:80 jc21/registry-ui 

I get the following error

WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
WARNING: No configurations found in configuration directory:/app/config
WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.
[9/7/2020] [12:51:50 AM] [Global  ] › ℹ  info      PID 6 listening on port 80 ...
[9/7/2020] [12:51:50 AM] [Global  ] › ℹ  info      Registry Host: https://docker.kube.unc.nc
[9/7/2020] [12:52:05 AM] [Express ] › ⚠  warning   Error: getaddrinfo EAI_AGAIN https https:80
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:58:26)

I don't understand this error. Any ideas ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.