Commit 2301aa91 authored by nimrod's avatar nimrod
Browse files

Docker clean.

Run the docker-clean image daily. Remove failed builds and such.
parent 8e2a1748
Loading
Loading
Loading
Loading

crond/.dockerignore

0 → 100644
+2 −0
Original line number Diff line number Diff line
*
!crontab

crond/Dockerfile

0 → 100644
+8 −0
Original line number Diff line number Diff line
FROM docker:19.03 as docker

# hadolint ignore=DL3006
FROM adarnimrod/cron as supersonic
COPY --from=docker /usr/local/bin/docker /usr/local/bin/
COPY --chown=root:root crontab /crontab
# hadolint ignore=DL3002
USER root

crond/README.md

0 → 100644
+20 −0
Original line number Diff line number Diff line
# crond

> Cron container image.

## Description

This container periodically runs the [docker-clean
image](https://hub.docker.com/r/adarnimrod/docker-clean). For this the `dockerd`
socket is bind mounted to this container.

## 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/nimrod/>.

crond/crontab

0 → 100644
+1 −0
Original line number Diff line number Diff line
@daily docker run --rm --name=docker-clean --volume /var/run/docker.sock:/var/run/docker.sock adarnimrod/docker-clean
+5 −0
Original line number Diff line number Diff line
@@ -15,6 +15,11 @@ services:
    volumes:
      - config:/etc/gitlab-runner
      - /var/run/docker.sock:/var/run/docker.sock
  crond:
    build:
      context: crond/
    volumes:
      - /run/docker.sock:/run/docker.sock

volumes:
  config: