reactor(dockerfile): 使用debian构建docker (#5169)

Co-authored-by: ibuler <ibuler@qq.com>
pull/5172/head
fit2bot 2020-12-03 19:14:28 +08:00 committed by GitHub
parent c8d54b28e2
commit 662c9092dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 19 deletions

View File

@ -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 ARG VERSION
ENV VERSION=$VERSION ENV VERSION=$VERSION
@ -8,29 +9,30 @@ ADD . .
RUN cd utils && bash -ixeu build.sh 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 ARG PIP_MIRROR=https://pypi.douban.com/simple
ENV PIP_MIRROR=$PIP_MIRROR 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 MYSQL_MIRROR=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql57-community-el6/
ENV MYSQL_MIRROR=$MYSQL_MIRROR
WORKDIR /opt/jumpserver WORKDIR /opt/jumpserver
COPY ./requirements ./requirements COPY ./requirements/deb_buster_requirements.txt ./requirements/deb_buster_requirements.txt
RUN useradd jumpserver RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \
RUN wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo && sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \
RUN yum -y install epel-release && \ && apt update
echo -e "[mysql]\nname=mysql\nbaseurl=${MYSQL_MIRROR}\ngpgcheck=0\nenabled=1" > /etc/yum.repos.d/mysql.repo RUN grep -v '^#' ./requirements/deb_buster_requirements.txt | xargs apt -y install
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} && \ COPY ./requirements/requirements.txt ./requirements/requirements.txt
pip config set global.index-url ${PIP_MIRROR} RUN pip install --upgrade pip==20.2.4 setuptools==49.6.0 wheel==0.34.2 -i ${PIP_MIRROR} \
RUN pip install --no-cache-dir $(grep 'jms' requirements/requirements.txt) -i ${PIP_JMS_MIRROR} && pip config set global.index-url ${PIP_MIRROR} \
RUN pip install --no-cache-dir -r requirements/requirements.txt && 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 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 RUN echo > config.yml
VOLUME /opt/jumpserver/data VOLUME /opt/jumpserver/data

View File

@ -41,7 +41,7 @@ def timesince(dt, since='', default="just now"):
3 days, 5 hours. 3 days, 5 hours.
""" """
if since is '': if not since:
since = datetime.datetime.utcnow() since = datetime.datetime.utcnow()
if since is None: if since is None:

View File

@ -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

View File

@ -58,7 +58,7 @@ pycryptodomex==3.9.9
pyotp==2.2.6 pyotp==2.2.6
PyNaCl==1.2.1 PyNaCl==1.2.1
python-dateutil==2.6.1 python-dateutil==2.6.1
python-gssapi==0.6.4 #python-gssapi==0.6.4
pytz==2018.3 pytz==2018.3
PyYAML==5.1 PyYAML==5.1
redis==3.5.3 redis==3.5.3

View File

@ -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