Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Fabio Montefuscolo
docker-awscron
Commits
274f9602
Commit
274f9602
authored
Apr 10, 2017
by
Fabio Montefuscolo
Browse files
initial commit
parents
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
Dockerfile
Dockerfile
+20
-0
entrypoint.sh
entrypoint.sh
+23
-0
No files found.
Dockerfile
0 → 100644
View file @
274f9602
FROM
alpine:latest
MAINTAINER
Fabio Montefuscolo <fabio.montefuscolo@gmail.com>
RUN
apk update
&&
\
apk add dcron
&&
\
rm
-rf
/var/cache/apk/
*
VOLUME
[ \
"/etc/periodic/15min", \
"/etc/periodic/hourly", \
"/etc/periodic/daily", \
"/etc/periodic/weekly", \
"/etc/periodic/monthly" \
]
COPY
entrypoint.sh /entrypoint.sh
ENTRYPOINT
["/entrypoint.sh"]
CMD
[ "crond", "-d", "-l5" ]
entrypoint.sh
0 → 100755
View file @
274f9602
#!/bin/sh
DAEMON
=
crond
stop
()
{
echo
"Received SIGINT or SIGTERM. Shutting down
$DAEMON
"
pid
=
$(
cat
/var/run/
$DAEMON
/
$DAEMON
.pid
)
kill
-SIGTERM
"
${
pid
}
"
wait
"
${
pid
}
"
echo
"Done."
}
echo
"Running
$@
"
if
[
"
$(
basename
$1
)
"
==
"
$DAEMON
"
]
;
then
trap
stop SIGINT SIGTERM
$@
&
pid
=
"
$!
"
mkdir
-p
/var/run/
$DAEMON
&&
echo
"
${
pid
}
"
>
/var/run/
$DAEMON
/
$DAEMON
.pid
wait
"
${
pid
}
"
&&
exit
$?
else
exec
"
$@
"
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment