mirror of https://github.com/jumpserver/jumpserver
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
parent
a73c8d8285
commit
87e54d8823
|
@ -1,4 +1,4 @@
|
|||
FROM jumpserver/core-base:20241022_070738 AS stage-build
|
||||
FROM jumpserver/core-base:20241028_064236 AS stage-build
|
||||
|
||||
ARG VERSION
|
||||
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue