commit 66287f4049f3b13de0ebe834735ec72dcd209853 Author: Wolfgang Hottgenroth Date: Wed Jul 20 12:55:10 2022 +0200 initial diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6d7bb8d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM debian:bullseye + +ARG APP_DIR="/opt/app" + +RUN \ + apt update && \ + apt install -y cron && \ + mkdir -p ${APP_DIR} && \ + useradd -d ${APP_DIR} -u 1000 user + +COPY crontab /etc/ +COPY testscript.sh ${APP_DIR}/ + +# USER 1000:1000 +WORKDIR ${APP_DIR} + +CMD [ "/usr/sbin/cron", "-f" ] + + + + + + diff --git a/crontab b/crontab new file mode 100644 index 0000000..f48ee52 --- /dev/null +++ b/crontab @@ -0,0 +1,2 @@ +*/2 * * * * user /opt/app/testscript.sh + diff --git a/testscript.sh b/testscript.sh new file mode 100755 index 0000000..b92e735 --- /dev/null +++ b/testscript.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +date > /tmp/date.log + +