Skip to content

Commit d24a662

Browse files
First commit
1 parent 1096c82 commit d24a662

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ RUN apk add --no-cache \
1717

1818
COPY crontab-entrypoint.sh /usr/local/bin/
1919

20-
RUN mkdir /app
20+
RUN mkdir /app && rm -fr /etc/periodic
2121

2222
WORKDIR /app
2323

2424
ENTRYPOINT ["crontab-entrypoint.sh"]
2525

26-
CMD ["crond", "-f", "-L", "/dev/stdout", "-l", "0", "-d", "0"]
26+
CMD ["crond", "-f", "-L", "/dev/stdout", "-l", "8"]

crontab-entrypoint.sh

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#!/usr/bin/env bash
2+
set -e
23

3-
echo "INPUT 1: $1"
4-
echo "INPUT FULL: $@"
4+
>/var/spool/cron/crontabs/root
55

6-
if [[ "$1" =~ ^[1-9*]\ ]]; then
7-
set -- crond -f -L /dev/stdout -l 0 -d 0
6+
if [[ "$1" =~ ^[1-9*] ]]; then
7+
while test $# -gt 0; do
8+
echo "$1" >> /var/spool/cron/crontabs/root
9+
shift
10+
done
11+
set -- crond -f -L /dev/stdout -l 8
812
fi
913

10-
echo "NEW $@"
14+
if [ -f /etc/crontab ]; then
15+
cat /etc/crontab >> /var/spool/cron/crontabs/root
16+
fi
1117

12-
#docker-entrypoint.sh "$@"
18+
docker-entrypoint.sh "$@"

0 commit comments

Comments
 (0)