Skip to content

Dalee/hitman

Repository files navigation

Docker Distribution (Registry) UI

Build Status codecov Go Report Card

Web UI for Private Docker Distribution (Registry).

Features

Requirements

  • Registry 2.6+ (should be ok with > 2.3 but untested)
  • CLI access to host where Registry is running (run garbage-collect command)

Prebuilt docker image

Run somewhere on Docker enabled host:

$ docker pull dalee/hitman
$ docker run \
    -e MACARON_ENV=production \
    -e REGISTRY_URL=https://registry.example.com:5000/ \
    dalee/hitman

Put command to your favourite scheduler (cron, ci, etc..)

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

Where docker.registry is name of container running Docker Registry.

Common pitfalls

  • There is no auth, so, restrict access to UI via frontend (NGINX deny/allow for example)
  • Multiple tags could point to single digest (you can have latest and v1.0.1 tags, but they actually single image, so be careful)
  • Tag deletion will not free you hard drive space until garbage-collect command is issued
  • Depending on storage driver, you may have to manually delete empty repositories (ui will show you hint)

Licensing

Software is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Development

Setting up developer dependencies:

$ make install

You can also use yarn instead of npm:

$ yarn --pure-lockfile

Run server:

$ go run ./bin/main.go -registry-url=https://registry.example.com:5000/

Full list of commands:

  • make docker — build docker image
  • make install — install all development dependencies
  • make format-backend — gofmt sources
  • make test — test backend and frontend code
  • make test-backend — test backend sources
  • make test-frontend — test frontend sources
  • make coverage-backend ; go tool cover -html=coverage.txt — display backend coverage

Build UI (required after any jsx/css change):

$ npm run build

Point your browser to http://localhost:4000/