Skip to content

Instantly share code, notes, and snippets.

@x-yuri
Last active March 23, 2023 19:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x-yuri/b21d457de5025379c7657fb7b139267b to your computer and use it in GitHub Desktop.
Save x-yuri/b21d457de5025379c7657fb7b139267b to your computer and use it in GitHub Desktop.
docker + dcron

docker + dcron

Use -l loglevel or -d to make it more verbose. The log levels are:

  • emerg (panic)
  • alert
  • crit
  • err (error)
  • warning (warn)
  • notice
  • info
  • debug

docker-compose.yml:

services:
  dcron:
    build: .
    command: crond -fl info
    init: yes

Dockerfile:

FROM alpine:3.17
RUN set -x \
    && apk add --no-cache dcron shadow \
    && useradd -m app
COPY crontab /etc/crontabs/app

crontab:

* * * * * date >/dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment