From 35b8b080abf7d84cd3daf1d403b8cd7aa3eed735 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:15:07 +0800 Subject: [PATCH] perf: add to cron.d (#14375) * perf: add to cron.d * perf: Update Dockerfile with new base image tag --------- Co-authored-by: ibuler Co-authored-by: github-actions[bot] --- Dockerfile | 6 ++++-- Dockerfile-base | 5 ----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1256d33d4..6a607ace8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM jumpserver/core-base:20241029_070330 AS stage-build +FROM jumpserver/core-base:20241029_080218 AS stage-build ARG VERSION @@ -46,7 +46,9 @@ RUN set -ex \ && echo "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null\n\tCiphers +aes128-cbc\n\tKexAlgorithms +diffie-hellman-group1-sha1\n\tHostKeyAlgorithms +ssh-rsa" > /root/.ssh/config \ && echo "no" | dpkg-reconfigure dash \ && apt-get clean all \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* \ + && 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 COPY --from=stage-build /opt /opt COPY --from=stage-build /usr/local/bin /usr/local/bin diff --git a/Dockerfile-base b/Dockerfile-base index 78baff706..34219bf65 100644 --- a/Dockerfile-base +++ b/Dockerfile-base @@ -7,7 +7,6 @@ ARG DEPENDENCIES=" \ wget \ g++ \ make \ - cron \ pkg-config \ default-libmysqlclient-dev \ freetds-dev \ @@ -28,10 +27,6 @@ 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 \