Skip to content

scalaone/cleanup-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cleanup your docker daemon periodically

Reason

I am running a gitlab worker for building my arm docker images. Usally it takes a few weeks until the worker is out of disk space.

To prevent this problem I created this small docker utility.

Cleanup

The following commands will be triggered on startup of the container.

crictl rmi --prune

Usage

cat << EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  labels:
    run: cleaner
  name: cleaner
spec:
  containers:
  - image: scalaone/cleanup-docker
    name: cleaner
    stdin: true
    stdinOnce: true
    tty: true
    volumeMounts:
    - mountPath: /var/run/containerd/containerd.sock
      name: containerdsock
      readOnly: true
  volumes:
  - name: containerdsock
    hostPath:
      path: /var/run/containerd/containerd.sock
EOF

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 70.6%
  • Shell 29.4%