From 0d338f80c534868bc59f8556c043538c5928d76e Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 5 Aug 2024 10:40:05 +0800 Subject: [PATCH] perf: ee dockerfile --- Dockerfile | 2 +- Dockerfile-ee | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 74549672a..7c36bbc96 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM jumpserver/core-base:20240724_070705 AS stage-build +FROM jumpserver/core-base:20240801_101727 AS stage-build ARG VERSION diff --git a/Dockerfile-ee b/Dockerfile-ee index c9443615d..8edbc1447 100644 --- a/Dockerfile-ee +++ b/Dockerfile-ee @@ -16,9 +16,7 @@ ARG TOOLS=" \ wget" ARG APT_MIRROR=http://deb.debian.org -RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \ - --mount=type=cache,target=/var/lib/apt,sharing=locked,id=core \ - set -ex \ +RUN set -ex \ && rm -f /etc/apt/apt.conf.d/docker-clean \ && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache \ && sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \ @@ -26,13 +24,12 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \ && apt-get -y install --no-install-recommends ${TOOLS} \ && echo "no" | dpkg-reconfigure dash +WORKDIR /opt/jumpserver ARG PIP_MIRROR=https://pypi.org/simple -RUN --mount=type=bind,source=poetry.lock,target=/opt/jumpserver/poetry.lock \ - --mount=type=bind,source=pyproject.toml,target=/opt/jumpserver/pyproject.toml \ - set -ex \ - . /opt/py3/bin/activate \ +COPY poetry.lock pyproject.toml ./ +RUN set -ex \ + && . /opt/py3/bin/activate \ && pip install poetry -i ${PIP_MIRROR} \ - && poetry config repositories.mirror ${PIP_MIRROR} \ && poetry install --only xpack