diff --git a/Dockerfile b/Dockerfile index a1091295c..db01ffb12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM jumpserver/core-base:20241022_070738 AS stage-build +FROM jumpserver/core-base:20241028_064236 AS stage-build ARG VERSION diff --git a/Dockerfile-base b/Dockerfile-base index e76fd69fe..bd9440167 100644 --- a/Dockerfile-base +++ b/Dockerfile-base @@ -5,6 +5,7 @@ ARG TARGETARCH ARG DEPENDENCIES=" \ ca-certificates \ wget \ + cron \ gettext" ARG APT_MIRROR=http://deb.debian.org @@ -19,6 +20,10 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \ && apt-get -y install --no-install-recommends ${DEPENDENCIES} \ && echo "no" | dpkg-reconfigure dash +# Clean up /tmp +RUN echo "0 3 * * * root find /tmp -type f -mtime +1 -size +1M -exec rm -f {} \; && date > /tmp/clean.log" > /etc/cron.d/cleanup_tmp \ + && chmod 0644 /etc/cron.d/cleanup_tmp + # Install bin tools ARG CHECK_VERSION=v1.0.4 RUN set -ex \ diff --git a/entrypoint.sh b/entrypoint.sh index acd23b51c..db28e7f5e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -22,5 +22,6 @@ elif [[ "$action" == "sleep" ]];then echo "Sleep 365 days" sleep 365d else + which cron &>/dev/null && [[ ! -f /var/run/crond.pid ]] && cron || echo "" python jms "${action}" "${service}" fi