jumpserver/Dockerfile-ee

53 lines
2.0 KiB
Plaintext
Raw Normal View History

ARG VERSION
2023-08-03 06:33:22 +00:00
FROM registry.fit2cloud.com/jumpserver/xpack:${VERSION} as build-xpack
FROM python:3.11-slim-bullseye as build-core
ARG BUILD_DEPENDENCIES=" \
g++"
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
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 \
&& 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 \
&& apt-get update \
&& apt-get -y install --no-install-recommends ${BUILD_DEPENDENCIES} \
&& echo "no" | dpkg-reconfigure dash
2024-04-02 16:11:41 +00:00
WORKDIR /opt/jumpserver
ARG PIP_MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple
RUN --mount=type=cache,target=/root/.cache,sharing=locked,id=core \
2024-04-02 16:11:41 +00:00
--mount=type=bind,source=poetry.lock,target=/opt/jumpserver/poetry.lock \
--mount=type=bind,source=pyproject.toml,target=/opt/jumpserver/pyproject.toml \
set -ex \
&& python3 -m venv /opt/py3 \
&& pip install poetry -i ${PIP_MIRROR} \
&& poetry config virtualenvs.create false \
2024-05-13 10:21:51 +00:00
&& . /opt/py3/bin/activate \
&& poetry install --only xpack
2024-05-13 10:21:51 +00:00
FROM registry.fit2cloud.com/jumpserver/core:${VERSION}-ce
2024-04-02 16:11:41 +00:00
ARG TARGETARCH
ARG TOOLS=" \
curl \
iputils-ping \
2024-04-30 03:07:38 +00:00
netcat-openbsd \
2024-04-02 16:11:41 +00:00
nmap \
telnet \
vim \
wget"
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=core \
2024-05-06 02:38:02 +00:00
set -ex \
2024-04-02 16:11:41 +00:00
&& apt-get update \
&& apt-get -y install --no-install-recommends ${TOOLS}
2024-04-02 16:11:41 +00:00
COPY --from=build-core /opt/py3 /opt/py3
COPY --from=build-xpack /opt/xpack /opt/jumpserver/apps/xpack