forked from Lesin/reposync
更新dockerfile
This commit is contained in:
parent
33a3763410
commit
4e5d5672ce
32
Dockerfile
32
Dockerfile
|
@ -1,18 +1,33 @@
|
|||
FROM centos:7
|
||||
|
||||
# 更新Yum源为阿里云
|
||||
RUN curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
|
||||
|
||||
# 安装系统依赖和工具
|
||||
RUN yum update -y && \
|
||||
yum install -y wget gcc make openssl-devel bzip2-devel libffi-devel zlib-devel
|
||||
RUN wget -P /data/ob-tool https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz
|
||||
RUN cd /data/ob-tool && tar xzf Python-3.9.6.tgz
|
||||
RUN cd /data/ob-tool/Python-3.9.6 && ./configure --enable-optimizations && make altinstall
|
||||
|
||||
# 下载并安装Python 3.9.6
|
||||
RUN wget -P /data/ob-tool https://mirrors.huaweicloud.com/python/3.9.6/Python-3.9.6.tgz && \
|
||||
cd /data/ob-tool && \
|
||||
tar xzf Python-3.9.6.tgz && \
|
||||
cd Python-3.9.6 && \
|
||||
./configure --enable-optimizations && \
|
||||
make altinstall
|
||||
|
||||
# 将项目文件复制到容器中
|
||||
ADD ./ /data/ob-robot/
|
||||
RUN cd /data/ob-robot/ && \
|
||||
pip3.9 install -r /data/ob-robot/requirement.txt
|
||||
|
||||
RUN yum install -y git openssh-server
|
||||
# 安装Python依赖
|
||||
RUN pip3.9 install -r /data/ob-robot/requirement.txt
|
||||
|
||||
# 安装Git和OpenSSH服务器
|
||||
RUN yum install -y git openssh-server
|
||||
|
||||
# 设置Git SSH连接配置
|
||||
ENV GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa'
|
||||
|
||||
# 安装autoconf和gettext,并编译安装Git 2.32.0
|
||||
RUN yum install -y autoconf gettext && \
|
||||
wget http://github.com/git/git/archive/v2.32.0.tar.gz && \
|
||||
tar -xvf v2.32.0.tar.gz && \
|
||||
|
@ -23,5 +38,8 @@ RUN yum install -y autoconf gettext && \
|
|||
make -j16 && \
|
||||
make install
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /data/ob-robot
|
||||
CMD if [ "$BOOT_MODE" = "app" ] ; then python3.9 main.py; fi
|
||||
|
||||
# 定义启动命令
|
||||
CMD if [ "$BOOT_MODE" = "app" ]; then python3.9 main.py; fi
|
||||
|
|
Loading…
Reference in New Issue