Skip to content

Instantly share code, notes, and snippets.

@x-yuri
Last active February 5, 2023 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x-yuri/4d6391931c0b6802f93e4c3c1f418066 to your computer and use it in GitHub Desktop.
Save x-yuri/4d6391931c0b6802f93e4c3c1f418066 to your computer and use it in GitHub Desktop.
docker + cronie

docker + cronie

There's no output unless any debug flag is set. The debug flags are:

  • ext - make other flags more verbose
  • sch - scheduling
  • proc - process control
  • pars - parsing
  • load - database loading
  • misc
  • test - test mode: don't execute any commands
  • bit - make it more verbose while not enabling any other flags?

docker-compose.yml:

services:
  cronie:
    build: .
    command: crond -fx bit

Dockerfile:

FROM alpine:3.17
COPY crontab .
RUN set -x \
    && apk add --no-cache cronie shadow \
    && useradd -m app \
    && crontab -u app crontab

crontab:

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