From 66287f4049f3b13de0ebe834735ec72dcd209853 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Wed, 20 Jul 2022 12:55:10 +0200 Subject: [PATCH] initial --- Dockerfile | 23 +++++++++++++++++++++++ crontab | 2 ++ testscript.sh | 5 +++++ 3 files changed, 30 insertions(+) create mode 100644 Dockerfile create mode 100644 crontab create mode 100755 testscript.sh 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 + +