simple-cron-docker/Dockerfile

34 lines
588 B
Docker
Raw Normal View History

2022-07-20 12:55:10 +02:00
FROM debian:bullseye
ARG APP_DIR="/opt/app"
RUN \
apt update && \
apt install -y cron && \
2022-07-20 16:12:35 +02:00
apt install -y openssh-server && \
2022-07-20 17:37:02 +02:00
apt install -y curl && \
2022-07-20 12:55:10 +02:00
mkdir -p ${APP_DIR} && \
2022-07-20 17:37:02 +02:00
useradd -d ${APP_DIR} -u 1000 user && \
mkdir -p ${APP_DIR}/.ssh && \
curl https://home.hottis.de/mysshkeys.pub > ${APP_DIR}/.ssh/authorized_keys
2022-07-20 12:55:10 +02:00
COPY crontab /etc/
COPY testscript.sh ${APP_DIR}/
2022-07-20 16:19:17 +02:00
COPY start.sh ${APP_DIR}/
2022-07-20 16:12:35 +02:00
COPY sshd_config /etc/ssh
RUN \
mkdir -p /var/run/sshd && \
/usr/bin/ssh-keygen -A
EXPOSE 2222
2022-07-20 12:55:10 +02:00
# USER 1000:1000
WORKDIR ${APP_DIR}
2022-07-20 16:12:35 +02:00
CMD [ "/opt/app/start.sh" ]
2022-07-20 12:55:10 +02:00