mirror of https://github.com/jumpserver/jumpserver
perf: 优化构建 (#9179)
* perf: 优化构建 * fix: 修正构建错误 * perf: 优化构建依赖包 * fix: 修正构建判断 * perf: 现阶段还需要 debug 工具 Co-authored-by: 吴小白 <296015668@qq.com>pull/9182/head
parent
beac2a1514
commit
0ae9b76f04
16
Dockerfile
16
Dockerfile
|
@ -18,7 +18,6 @@ ARG BUILD_DEPENDENCIES=" \
|
||||||
pkg-config"
|
pkg-config"
|
||||||
|
|
||||||
ARG DEPENDENCIES=" \
|
ARG DEPENDENCIES=" \
|
||||||
default-libmysqlclient-dev \
|
|
||||||
freetds-dev \
|
freetds-dev \
|
||||||
libpq-dev \
|
libpq-dev \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
|
@ -28,20 +27,15 @@ ARG DEPENDENCIES=" \
|
||||||
libxml2-dev \
|
libxml2-dev \
|
||||||
libxmlsec1-dev \
|
libxmlsec1-dev \
|
||||||
libxmlsec1-openssl \
|
libxmlsec1-openssl \
|
||||||
libaio-dev \
|
libaio-dev"
|
||||||
openssh-client \
|
|
||||||
sshpass"
|
|
||||||
|
|
||||||
ARG TOOLS=" \
|
ARG TOOLS=" \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
default-libmysqlclient-dev \
|
||||||
default-mysql-client \
|
|
||||||
iputils-ping \
|
|
||||||
locales \
|
locales \
|
||||||
procps \
|
openssh-client \
|
||||||
redis-tools \
|
sshpass \
|
||||||
telnet \
|
telnet \
|
||||||
vim \
|
|
||||||
unzip \
|
unzip \
|
||||||
wget"
|
wget"
|
||||||
|
|
||||||
|
@ -82,6 +76,8 @@ ENV PIP_MIRROR=$PIP_MIRROR
|
||||||
ARG PIP_JMS_MIRROR=https://pypi.douban.com/simple
|
ARG PIP_JMS_MIRROR=https://pypi.douban.com/simple
|
||||||
ENV PIP_JMS_MIRROR=$PIP_JMS_MIRROR
|
ENV PIP_JMS_MIRROR=$PIP_JMS_MIRROR
|
||||||
|
|
||||||
|
ARG DEBUG
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
set -ex \
|
set -ex \
|
||||||
&& pip config set global.index-url ${PIP_MIRROR} \
|
&& pip config set global.index-url ${PIP_MIRROR} \
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
ARG VERSION
|
||||||
|
FROM registry.fit2cloud.com/jumpserver/xpack:${VERSION} as build-xpack
|
||||||
|
FROM jumpserver/core:${VERSION}
|
||||||
|
COPY --from=build-xpack /opt/xpack /opt/jumpserver/apps/xpack
|
||||||
|
|
||||||
|
WORKDIR /opt/jumpserver
|
||||||
|
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
|
set -ex \
|
||||||
|
&& pip install -r requirements/requirements_xpack.txt
|
|
@ -18,7 +18,6 @@ ARG BUILD_DEPENDENCIES=" \
|
||||||
pkg-config"
|
pkg-config"
|
||||||
|
|
||||||
ARG DEPENDENCIES=" \
|
ARG DEPENDENCIES=" \
|
||||||
default-libmysqlclient-dev \
|
|
||||||
freetds-dev \
|
freetds-dev \
|
||||||
libpq-dev \
|
libpq-dev \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
|
@ -28,20 +27,15 @@ ARG DEPENDENCIES=" \
|
||||||
libxml2-dev \
|
libxml2-dev \
|
||||||
libxmlsec1-dev \
|
libxmlsec1-dev \
|
||||||
libxmlsec1-openssl \
|
libxmlsec1-openssl \
|
||||||
libaio-dev \
|
libaio-dev"
|
||||||
openssh-client \
|
|
||||||
sshpass"
|
|
||||||
|
|
||||||
ARG TOOLS=" \
|
ARG TOOLS=" \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
default-libmysqlclient-dev \
|
||||||
default-mysql-client \
|
|
||||||
iputils-ping \
|
|
||||||
locales \
|
locales \
|
||||||
netcat \
|
openssh-client \
|
||||||
redis-server \
|
sshpass \
|
||||||
telnet \
|
telnet \
|
||||||
vim \
|
|
||||||
unzip \
|
unzip \
|
||||||
wget"
|
wget"
|
||||||
|
|
||||||
|
@ -69,12 +63,14 @@ ENV PIP_MIRROR=$PIP_MIRROR
|
||||||
ARG PIP_JMS_MIRROR=https://pypi.douban.com/simple
|
ARG PIP_JMS_MIRROR=https://pypi.douban.com/simple
|
||||||
ENV PIP_JMS_MIRROR=$PIP_JMS_MIRROR
|
ENV PIP_JMS_MIRROR=$PIP_JMS_MIRROR
|
||||||
|
|
||||||
|
ARG DEBUG
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
set -ex \
|
set -ex \
|
||||||
&& pip config set global.index-url ${PIP_MIRROR} \
|
&& pip config set global.index-url ${PIP_MIRROR} \
|
||||||
&& pip install --upgrade pip \
|
&& pip install --upgrade pip \
|
||||||
&& pip install --upgrade setuptools wheel \
|
&& pip install --upgrade setuptools wheel \
|
||||||
&& pip install https://download.jumpserver.org/pypi/simple/cryptography/cryptography-36.0.1-cp38-cp38-linux_loongarch64.whl \
|
&& pip install https://download.jumpserver.org/pypi/simple/cryptography/cryptography-36.0.2-cp38-cp38-linux_loongarch64.whl \
|
||||||
&& pip install https://download.jumpserver.org/pypi/simple/greenlet/greenlet-1.1.2-cp38-cp38-linux_loongarch64.whl \
|
&& pip install https://download.jumpserver.org/pypi/simple/greenlet/greenlet-1.1.2-cp38-cp38-linux_loongarch64.whl \
|
||||||
&& pip install $(grep 'PyNaCl' requirements/requirements.txt) \
|
&& pip install $(grep 'PyNaCl' requirements/requirements.txt) \
|
||||||
&& GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true pip install grpcio \
|
&& GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true pip install grpcio \
|
||||||
|
|
|
@ -25,7 +25,7 @@ paramiko==2.11.0
|
||||||
passlib==1.7.4
|
passlib==1.7.4
|
||||||
pyasn1==0.4.8
|
pyasn1==0.4.8
|
||||||
pycparser==2.21
|
pycparser==2.21
|
||||||
cryptography==37.0.4
|
cryptography==36.0.2
|
||||||
pycryptodome==3.15.0
|
pycryptodome==3.15.0
|
||||||
pycryptodomex==3.15.0
|
pycryptodomex==3.15.0
|
||||||
gmssl==3.2.1
|
gmssl==3.2.1
|
||||||
|
@ -87,7 +87,6 @@ pytz==2022.1
|
||||||
# Runtime
|
# Runtime
|
||||||
django-proxy==1.2.1
|
django-proxy==1.2.1
|
||||||
channels-redis==3.4.0
|
channels-redis==3.4.0
|
||||||
channels==3.0.4
|
|
||||||
python-daemon==2.3.0
|
python-daemon==2.3.0
|
||||||
eventlet==0.33.1
|
eventlet==0.33.1
|
||||||
greenlet==1.1.2
|
greenlet==1.1.2
|
||||||
|
@ -107,23 +106,6 @@ django-cas-ng==4.0.1
|
||||||
python-cas==1.5.0
|
python-cas==1.5.0
|
||||||
django-auth-ldap==2.2.0
|
django-auth-ldap==2.2.0
|
||||||
# Cloud req
|
# Cloud req
|
||||||
qingcloud-sdk==1.2.12
|
|
||||||
azure-mgmt-subscription==1.0.0
|
|
||||||
azure-identity==1.5.0
|
|
||||||
azure-mgmt-compute==4.6.2
|
|
||||||
azure-mgmt-network==2.7.0
|
|
||||||
google-cloud-compute==0.5.0
|
|
||||||
alibabacloud_dysmsapi20170525==2.0.2
|
|
||||||
python-novaclient==11.0.1
|
|
||||||
python-keystoneclient==4.3.0
|
|
||||||
bce-python-sdk==0.8.64
|
|
||||||
tencentcloud-sdk-python==3.0.662
|
|
||||||
aliyun-python-sdk-core-v3==2.9.1
|
|
||||||
aliyun-python-sdk-ecs==4.10.1
|
|
||||||
huaweicloud-sdk-python==1.0.21
|
|
||||||
# python-keystoneclient need keystoneauth1>=3.4.0
|
|
||||||
# huaweicloud-sdk-python need keystoneauth1<=3.4.0
|
|
||||||
keystoneauth1==3.4.0
|
|
||||||
boto3==1.24.12
|
boto3==1.24.12
|
||||||
botocore==1.27.12
|
botocore==1.27.12
|
||||||
s3transfer==0.6.0
|
s3transfer==0.6.0
|
||||||
|
@ -131,8 +113,6 @@ kubernetes==21.7.0
|
||||||
# DB requirements
|
# DB requirements
|
||||||
mysqlclient==2.1.0
|
mysqlclient==2.1.0
|
||||||
PyMySQL==1.0.2
|
PyMySQL==1.0.2
|
||||||
oracledb==1.0.1
|
|
||||||
psycopg2-binary==2.9.1
|
|
||||||
pymssql==2.2.5
|
pymssql==2.2.5
|
||||||
django-mysql==3.9.0
|
django-mysql==3.9.0
|
||||||
django-redis==5.2.0
|
django-redis==5.2.0
|
||||||
|
@ -146,5 +126,3 @@ ipython==8.4.0
|
||||||
ForgeryPy3==0.3.1
|
ForgeryPy3==0.3.1
|
||||||
django-debug-toolbar==3.5
|
django-debug-toolbar==3.5
|
||||||
Pympler==1.0.1
|
Pympler==1.0.1
|
||||||
IPy==1.1
|
|
||||||
psycopg2==2.9.4
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Cloud req
|
||||||
|
qingcloud-sdk==1.2.12
|
||||||
|
azure-mgmt-subscription==1.0.0
|
||||||
|
azure-identity==1.5.0
|
||||||
|
azure-mgmt-compute==4.6.2
|
||||||
|
azure-mgmt-network==2.7.0
|
||||||
|
google-cloud-compute==0.5.0
|
||||||
|
alibabacloud_dysmsapi20170525==2.0.2
|
||||||
|
python-novaclient==11.0.1
|
||||||
|
python-keystoneclient==4.3.0
|
||||||
|
bce-python-sdk==0.8.64
|
||||||
|
tencentcloud-sdk-python==3.0.662
|
||||||
|
aliyun-python-sdk-core-v3==2.9.1
|
||||||
|
aliyun-python-sdk-ecs==4.10.1
|
||||||
|
huaweicloud-sdk-python==1.0.21
|
||||||
|
# python-keystoneclient need keystoneauth1>=3.4.0
|
||||||
|
# huaweicloud-sdk-python need keystoneauth1<=3.4.0
|
||||||
|
keystoneauth1==3.4.0
|
||||||
|
# DB requirements
|
||||||
|
oracledb==1.0.1
|
||||||
|
psycopg2-binary==2.9.1
|
||||||
|
pymssql==2.2.5
|
||||||
|
IPy==1.1
|
||||||
|
psycopg2==2.9.4
|
Loading…
Reference in New Issue