Skip to content
Snippets Groups Projects
Commit d54701e6 authored by nimrod's avatar nimrod
Browse files

Periodic garbage collection.

- Add a crond image.
- Add a weekly Cron job to run garbage collection.
parent dc21f082
No related branches found
No related tags found
No related merge requests found
Pipeline #2234 passed
*
!crontab
# hadolint ignore=DL3006
FROM registry.shore.co.il/cron as supersonic
# hadolint ignore=DL3002
USER root
# hadolint ignore=DL3018
RUN apk add --update --no-cache docker-cli
# crond
> Cron container image.
## Description
Periodically run the registry's garbage collection. It should be improved to
first put the registry in a read-only mode or disable the Nginx proxy or
something.
## License
This software is licensed under the MIT license (see `LICENSE.txt`).
## Author Information
Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my
[website](https://www.shore.co.il/). Patches are welcome via
[`git send-email`](http://git-scm.com/book/en/v2/Git-Commands-Email). The repository
is located at: <https://git.shore.co.il/explore/>.
@weekly docker exec registry_registry_1 registry garbage-collect /etc/docker/registry/config.yml
......@@ -16,6 +16,7 @@ services:
restart: always
volumes:
- "registry:/var/lib/registry"
reg:
command:
- "server"
......@@ -34,6 +35,13 @@ services:
image: r.j3ss.co/reg:v0.16.1
restart: always
crond:
build:
context: crond/
restart: always
volumes:
- /run/docker.sock:/run/docker.sock
volumes:
registry:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment