cron inside docker not running jobs on linux host (but running jobs on mac host)

I have a test docker container with cron running in the foreground. The cron should say “hello” every minute. But it does not. It works on my Mac but it doesn’t work on my server (Ubuntu 18.04.1). It just hangs and does nothing like if there wasn’t any cron scheduled.

this is my Dockerfile (./crond/Dockerfile):

FROM alpine:3.10
RUN apk add --no-cache bash
RUN apk add --no-cache docker
RUN apk add --no-cache docker-compose

this is my docker-compose.yml (./):

version: '3.5'
    image: crond
      context: ./crond
    entrypoint: /docker-container-entrypoint
      - ./crontab:/var/spool/cron/crontabs/root
      - ./crond/entrypoint:/docker-container-entrypoint
      - /var/run/docker.sock:/var/run/docker.sock

this is the entrypoint (./crond/entrypoint)

SHELL=/bin/bash crond -l 8 -f

this is the crontab file (./crontab):

*  *  *  *  * echo "hello"

Source: StackOverflow