reposync/Dockerfile

42 lines
1.3 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM quay.io/centos/centos:7
RUN mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup && \
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo && \
yum makecache
# 安装软件包
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
ADD ./ /data/ob-robot/
RUN cd /data/ob-robot/ && \
pip3.9 install -r /data/ob-robot/requirement.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
# 安装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 https://github.com/git/git/archive/v2.32.0.tar.gz && \
tar -xvf v2.32.0.tar.gz && \
rm -f v2.32.0.tar.gz && \
cd git-* && \
make configure && \
./configure --prefix=/usr && \
make -j16 && \
make install
# 设置工作目录
WORKDIR /data/ob-robot
# 定义启动命令
CMD if [ "$BOOT_MODE" = "app" ]; then python3.9 main.py; fi