docker 小白一枚,求大神解答

一、前提准备

1、制作的镜像 Dockerfile

FROM centos:7

ADD entrypoint.sh /root
ADD requirement.txt /root
WORKDIR /root
USER root

RUN yum install -y epel-release \
    && yum install -y python34 git python34-setuptools python34-devel.x86_64 \
    && easy_install-3.4 pip \
    && yum install -y gcc \
    && yum install -y soci-mysql-devel.x86_64 \
    && ln -s /usr/local/mysql/bin/mysql /usr/bin \
    && pip3 install -r requirement.txt -i https://mirrors.aliyun.com/pypi/simple/


ENTRYPOINT ["/root/entrypoint.sh"]

2、entrypoint.sh 文件

#!/bin/bash

mkdir -p /opt/web
cd /opt/web
git clone https://github.com/ycwdaaaa/holmes.git
cd holmes
pip3 install -r requirement.txt -i https://mirrors.aliyun.com/pypi/simple/
python3 app.py


while true
do
   sleep 10
done

二、问题现象


Python 默认 2.7 版本

三、容器如何切换 py2.x 与 py3.x 版本呢,求助


↙↙↙阅读原文可查看相关链接,并与作者交流