docker安装python

1.查询镜像

https://hub.docker.com/search?operating_system=linux&source=verified&type=image

2.拉取镜像

#拉取镜像(最新镜像)
docker pull python
#查询镜像
docker images
#运行镜像  entrypoint bash  不进入后台运行
docker run -it  --entrypoint bash python

3.测试是否按照成功

[root@bogon redis]# docker  run  -it --entrypoint bash python:latest
root@aef564097eef:/# uname -a
Linux aef564097eef 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 GNU/Linux
root@aef564097eef:/# python
Python 3.7.4 (default, Jul 13 2019, 14:04:11) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print ('222')
222
>>> 
root@aef564097eef:/# 

进入python后按Ctrl+D退出,exit再次退出

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值