qdyxmas's Room

Done is better than perfect...

CentOS7安装Docker python36的环境

CentOS7安装Docker python36的环境

1.安装docker

yum install -y docker  #安装docker
systemctl start docker #开启docker服务
docker pull python:3.6  #拉取python3.6的环境,没有其他的库的内容

2.配置Dockerfile文件 FORM python:3.6

RUN mkdir /python36_docker
WORKDIR /python36_docker
COPY requirements.txt /python36_docker/requirements.txt

RUN pip3 install virtualenv
RUN source bin/activate
RUN pip3 install requests
RUN pip3 install -r requirements.txt

3.创建docker images

docker build -t docker_python .

4.运行docker images

docker run  -itd docker_python:latest

5.进入容器

docker ps #查看启动的容器,选择启动的docker_python:latest的容器好进入
docker attach 9a90107e2003

参考链接:https://blog.csdn.net/qq_22211217/article/details/80414227 https://www.cnblogs.com/xuanmanstein/p/7630606.html https://baijiahao.baidu.com/s?id=1589924250945546299&wfr=spider&for=pc https://www.cnblogs.com/xhyan/p/6593075.html

标签 

评论