Sign inSign up

jinxuan/cleans_image

By jinxuan

•Updated almost 7 years ago

docker cleans image

Image
0

39

jinxuan/cleans_image repository overview

parameterdefaultexplain
oncefalsePerform the cleanup task only once
cron"0 0 3 * MON *"Perform the cleaning task regularly and follow the cron expression default 0 0 3 * MON *
forcetrueForce image removal
tryRunfalseTry to run without deleting the image

run in docker

docker run -it -d --name=clean-image -v /var/run/docker.sock:/var/run/docker.sock   jinxuan/cleans_image:0.0.1 --once=true

run in k8s

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: cleans-image
  labels:
    app: cleans-image
spec:
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: cleans-image
    spec:
      tolerations:
        - key: node-role.kubernetes.io/master
          effect: NoSchedule
      containers:
        - name: cleans-image
          image: jinxuan/cleans_image:0.0.1
          args:
            - "--cron=0 0 0 * * *"
          volumeMounts:
            - name: sock
              mountPath: /var/run/docker.sock
      terminationGracePeriodSeconds: 30
      volumes:
        - name: sock
          hostPath:
            path: /var/run/docker.sock

Tag summary

Content type

Image

Digest

Size

72.6 MB

Last updated

almost 7 years ago

docker pull jinxuan/cleans_image:0.0.1