test2 #25

Open
topfive wants to merge 16 commits from jkcl/reposync:lcf_branch into master
1 changed files with 16 additions and 42 deletions
Showing only changes of commit 0a6107297e - Show all commits

View File

@ -1,53 +1,27 @@
FROM centos:7
RUN rm -rf /etc/yum.repos.d/* && \
# 配置yum源为阿里云镜像
RUN mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak && \
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo && \
sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/CentOS-Base.repo && \
yum clean all && \
yum makecache
RUN yum install -y \
wget \
gcc \
make \
openssl-devel \
bzip2-devel \
libffi-devel \
zlib-devel \
git \
openssh-server \
autoconf \
gettext && \
yum clean all
RUN mkdir -p /data/ob-tool /data/ob-robot
RUN wget -P /tmp https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz && \
tar xzf /tmp/Python-3.9.6.tgz -C /data/ob-tool && \
rm -f /tmp/Python-3.9.6.tgz && \
cd /data/ob-tool/Python-3.9.6 && \
./configure --enable-optimizations && \
make -j$(nproc) altinstall && \
rm -rf /data/ob-tool/Python-3.9.6
RUN wget -P /tmp https://github.com/git/git/archive/v2.32.0.tar.gz && \
tar xzf /tmp/v2.32.0.tar.gz -C /tmp && \
cd /tmp/git-2.32.0 && \
make configure && \
./configure --prefix=/usr && \
make -j$(nproc) install && \
rm -rf /tmp/git-2.32.0 /tmp/v2.32.0.tar.gz
RUN 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 pip3.9 install --no-cache-dir -r /data/ob-robot/requirement.txt
RUN cd /data/ob-robot/ && \
pip3.9 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r /data/ob-robot/requirement.txt
# Install OpenSSH and a modern version of Git from the IUS repository.
# This avoids manual compilation, making the build faster and more reliable.
RUN yum install -y openssh-server && \
yum install -y https://repo.ius.io/ius-release-el7.rpm && \
yum install -y git236
ENV GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa'
ENV GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa' \
BOOT_MODE=app
WORKDIR /data/ob-robot
CMD ["sh", "-c", "if [ \"$BOOT_MODE\" = \"app\" ]; then python3.9 main.py; fi"]
CMD if [ "$BOOT_MODE" = "app" ] ; then python3.9 main.py; fi