|
|
|
ARG VERSION
|
|
|
|
ARG BASE_IMAGE=registry.fit2cloud.com/jumpserver/core
|
|
|
|
|
|
|
|
FROM registry.fit2cloud.com/jumpserver/xpack:${VERSION} as build-xpack
|
|
|
|
FROM registry.fit2cloud.com/jumpserver/core:${VERSION}-base as build-core
|
|
|
|
ARG TARGETARCH
|
|
|
|
|
|
|
|
WORKDIR /opt/jumpserver
|
|
|
|
|
|
|
|
RUN --mount=type=cache,target=/root/.cache,sharing=locked \
|
|
|
|
--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 \
|
|
|
|
&& poetry install --only xpack
|
|
|
|
|
|
|
|
FROM ${BASE_IMAGE}:${VERSION}-lite
|
|
|
|
ARG TARGETARCH
|
|
|
|
|
|
|
|
ARG TOOLS=" \
|
|
|
|
curl \
|
|
|
|
iputils-ping \
|
|
|
|
netcat-openbsd \
|
|
|
|
nmap \
|
|
|
|
telnet \
|
|
|
|
vim \
|
|
|
|
wget"
|
|
|
|
|
|
|
|
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
|
|
|
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
|
|
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
|
|
|
set -ex \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get -y install --no-install-recommends ${TOOLS}
|
|
|
|
|
|
|
|
COPY --from=build-core /opt/py3 /opt/py3
|
|
|
|
COPY --from=build-xpack /opt/xpack /opt/jumpserver/apps/xpack
|