perf: add cron (#14364)

* perf: add cron

* Update Dockerfile-base

* perf: Update Dockerfile with new base image tag

---------

Co-authored-by: ibuler <ibuler@qq.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
pull/14370/head
fit2bot 2024-10-29 10:56:42 +08:00 committed by GitHub
parent a73c8d8285
commit 87e54d8823
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,4 @@
FROM jumpserver/core-base:20241022_070738 AS stage-build
FROM jumpserver/core-base:20241028_064236 AS stage-build
ARG VERSION

View File

@ -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 \

View File

@ -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