mirror of https://github.com/jumpserver/jumpserver
parent
c8d54b28e2
commit
662c9092dc
34
Dockerfile
34
Dockerfile
|
@ -1,5 +1,6 @@
|
|||
FROM registry.fit2cloud.com/public/python:v3 as stage-build
|
||||
MAINTAINER Jumpserver Team <ibuler@qq.com>
|
||||
# 编译代码
|
||||
FROM python:3.8.6-slim as stage-build
|
||||
MAINTAINER JumpServer Team <ibuler@qq.com>
|
||||
ARG VERSION
|
||||
ENV VERSION=$VERSION
|
||||
|
||||
|
@ -8,29 +9,30 @@ ADD . .
|
|||
RUN cd utils && bash -ixeu build.sh
|
||||
|
||||
|
||||
FROM registry.fit2cloud.com/public/python:v3
|
||||
# 构建运行时环境
|
||||
FROM python:3.8.6-slim
|
||||
ARG PIP_MIRROR=https://pypi.douban.com/simple
|
||||
ENV PIP_MIRROR=$PIP_MIRROR
|
||||
ARG PIP_JMS_MIRROR=https://pypi.douban.com/simple
|
||||
ENV PIP_JMS_MIRROR=$PIP_JMS_MIRROR
|
||||
ARG MYSQL_MIRROR=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql57-community-el6/
|
||||
ENV MYSQL_MIRROR=$MYSQL_MIRROR
|
||||
|
||||
WORKDIR /opt/jumpserver
|
||||
|
||||
COPY ./requirements ./requirements
|
||||
RUN useradd jumpserver
|
||||
RUN wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
|
||||
RUN yum -y install epel-release && \
|
||||
echo -e "[mysql]\nname=mysql\nbaseurl=${MYSQL_MIRROR}\ngpgcheck=0\nenabled=1" > /etc/yum.repos.d/mysql.repo
|
||||
RUN yum -y install $(cat requirements/rpm_requirements.txt)
|
||||
RUN pip install --upgrade pip==20.2.4 setuptools==49.6.0 wheel==0.34.2 -i ${PIP_MIRROR} && \
|
||||
pip config set global.index-url ${PIP_MIRROR}
|
||||
RUN pip install --no-cache-dir $(grep 'jms' requirements/requirements.txt) -i ${PIP_JMS_MIRROR}
|
||||
RUN pip install --no-cache-dir -r requirements/requirements.txt
|
||||
COPY ./requirements/deb_buster_requirements.txt ./requirements/deb_buster_requirements.txt
|
||||
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \
|
||||
&& sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \
|
||||
&& apt update
|
||||
RUN grep -v '^#' ./requirements/deb_buster_requirements.txt | xargs apt -y install
|
||||
|
||||
COPY ./requirements/requirements.txt ./requirements/requirements.txt
|
||||
RUN pip install --upgrade pip==20.2.4 setuptools==49.6.0 wheel==0.34.2 -i ${PIP_MIRROR} \
|
||||
&& pip config set global.index-url ${PIP_MIRROR} \
|
||||
&& pip install --no-cache-dir $(grep 'jms' requirements/requirements.txt) -i ${PIP_JMS_MIRROR} \
|
||||
&& pip install --no-cache-dir -r requirements/requirements.txt
|
||||
|
||||
COPY --from=stage-build /opt/jumpserver/release/jumpserver /opt/jumpserver
|
||||
RUN mkdir -p /root/.ssh/ && echo -e "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null" > /root/.ssh/config
|
||||
RUN mkdir -p /root/.ssh/ \
|
||||
&& echo -e "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null" > /root/.ssh/config
|
||||
|
||||
RUN echo > config.yml
|
||||
VOLUME /opt/jumpserver/data
|
||||
|
|
|
@ -41,7 +41,7 @@ def timesince(dt, since='', default="just now"):
|
|||
3 days, 5 hours.
|
||||
"""
|
||||
|
||||
if since is '':
|
||||
if not since:
|
||||
since = datetime.datetime.utcnow()
|
||||
|
||||
if since is None:
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
# common
|
||||
gcc
|
||||
cmake
|
||||
|
||||
# mysql-client
|
||||
default-libmysqlclient-dev
|
||||
|
||||
# Pillow
|
||||
# libffi-dev
|
||||
# libfreetype6-dev
|
||||
# libfribidi-dev
|
||||
# libharfbuzz-dev
|
||||
# libjpeg-turbo-progs
|
||||
# libjpeg62-turbo-dev
|
||||
# liblcms2-dev
|
||||
# libopenjp2-7-dev
|
||||
# libtiff5-dev
|
||||
# libwebp-dev
|
||||
# python3-tk
|
||||
# zlib1g-dev
|
||||
|
||||
|
||||
# ldap
|
||||
openssl
|
||||
libssl-dev
|
||||
libldap2-dev
|
||||
libsasl2-dev
|
||||
libkrb5-dev
|
||||
sqlite
|
||||
|
||||
# ansible
|
||||
sshpass
|
||||
|
|
@ -58,7 +58,7 @@ pycryptodomex==3.9.9
|
|||
pyotp==2.2.6
|
||||
PyNaCl==1.2.1
|
||||
python-dateutil==2.6.1
|
||||
python-gssapi==0.6.4
|
||||
#python-gssapi==0.6.4
|
||||
pytz==2018.3
|
||||
PyYAML==5.1
|
||||
redis==3.5.3
|
||||
|
|
|
@ -1 +1 @@
|
|||
gcc krb5-devel libtiff-devel libjpeg-devel libzip-devel freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel sshpass openldap-devel mariadb-devel mysql-community-devel mysql libffi-devel openssh-clients telnet openldap-clients
|
||||
gcc make krb5-devel libtiff-devel libjpeg-devel libzip-devel freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel sshpass openldap-devel mariadb-devel mysql-community-devel mysql libffi-devel openssh-clients telnet openldap-clients
|
||||
|
|
Loading…
Reference in New Issue