对 jdk1.8-python3.6.7:2.0 镜像进行修改
1.进入镜像所在的服务器
docker images |grep jdk1.8-python
2.启动镜像
docker run -dit --name=jdkpython21 850baef5f62e /bin/bash
说明:--name 容器名字
-d: 后台运行容器,并返回容器ID
-i: 以交互模式运行容器,通常与 -t 同时使用;
-t: 为容器重新分配一个伪输入终端,通常与 -i 同时使用;
3.进入容器
docker exec -it 2c9e2fcc826e /bin/bash
4.查看python环境
python3 --version
5.增加python的依赖:sklearn、statsmodels
a.增加之前先查看下是否安装了这两个依赖
pip list
b.安装依赖
pip3 install sklearn -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install statsmodels -i https://pypi.tuna.tsinghua.edu.cn/simple/
6.查看是否安装成功
pip list
7.退出容器
exit
8.将容器制作成镜像
docker commit 2c9e2fcc826e jdk1.8-python3.6.7:2.1
9.查看镜像
docker images |grep python
10.镜像成功,可以镜像启动验证一下,Dockerfile文件from就可以改成:FROM jdk1.8-python3.6.7:2.1
TRANSLATE with x
English
Arabic | Hebrew | Polish |
Bulgarian | Hindi | Portuguese |
Catalan | Hmong Daw | Romanian |
Chinese Simplified | Hungarian | Russian |
Chinese Traditional | Indonesian | Slovak |
Czech | Italian | Slovenian |
Danish | Japanese | Spanish |
Dutch | Klingon | Swedish |
English | Korean | Thai |
Estonian | Latvian | Turkish |
Finnish | Lithuanian | Ukrainian |
French | Malay | Urdu |
German | Maltese | Vietnamese |
Greek | Norwegian | Welsh |
Haitian Creole | Persian | |
TRANSLATE with
COPY THE URL BELOW
Back
EMBED THE SNIPPET BELOW IN YOUR SITE
Enable collaborative features and customize widget: Bing Webmaster Portal
Back