cannibal/entrypoint.sh

10 lines
322 B
Bash

#!/bin/sh
set -e
echo "Docker pruner starting as $(whoami). Schedule: ${PRUNE_SCHEDULE}"
# Write crontab from env var at runtime
CRONTAB_FILE=/tmp/crontab
echo "${PRUNE_SCHEDULE} /bin/sh -c '/usr/bin/docker system prune -af >> /tmp/prune.log 2>&1'" > "${CRONTAB_FILE}"
exec /usr/local/bin/supercronic "${CRONTAB_FILE}"