Initial commit

This commit is contained in:
dave 2017-07-22 13:31:33 -07:00
commit d79ae8fdd0
4 changed files with 39 additions and 0 deletions

19
Dockerfile Normal file
View File

@ -0,0 +1,19 @@
FROM ubuntu:xenial
RUN apt-get update && \
apt-get install -y wget python3-pip python-pip cron && \
pip install --upgrade pip && \
pip3 install --upgrade pip && \
find /etc/cron* -type f -delete && \
touch /etc/crontab && \
useradd ubuntu && \
rm -rf /var/lib/apt/lists/*
ADD start /start
ADD crontab /etc/cron.d/base
RUN chmod +x /start && \
mkdir -p /srv/cron && \
touch /srv/cron/crontab
ENTRYPOINT ["/start"]

9
README.md Normal file
View File

@ -0,0 +1,9 @@
docker-cron
===========
Cron in a container. Run any random crap you need.
The following paths should be added:
* `/srv/cron/startup` - a script to execute when the container starts
* `/srv/cron/crontab` - /etc/cron.d-style crontab

2
crontab Normal file
View File

@ -0,0 +1,2 @@
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

9
start Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash -eux
if test -x /srv/cron/startup ; then
/srv/cron/startup
fi
ln -s /srv/cron/crontab /etc/cron.d/
exec cron -f