Docker 笔记

1.Ubuntu安装Docker

安装Docker看这篇文章

http://t.csdnimg.cn/IsSsJ

2.在docker中运行python代码

2.1搭建python环境

docker部署python环境看这篇文章

http://t.csdnimg.cn/TYz0G

2.2在python shell中运行python代码

2.2.1查看镜像

2.2.1启动python,厦门这个是格式,<>里面的就是images对应的,需要自行修改

docker run -itd <REPOSITORY>:<tag> /bin/sh

 如下图

2.2.3 使用ps查看进程,看一下是否运行成功

docker ps

 这样就运行成功了

2.2.4 打开python shell

 docker exec -it py容器的id /bin/sh

 在#后面输入python就会显示版本号,然后进入python shell界面,ctrl+D可以退出python

3.删除报错

1.

Error response from daemon: conflict: unable to delete 6cbe1053f244 (must be forced) - image is being used by stopped container

解决方案

docker ri 运行ID
docker rmi 容器id

 这样就可以成功删除了

相关推荐

  1. docker笔记

    2024-03-31 06:04:04       52 阅读
  2. Docker笔记

    2024-03-31 06:04:04       25 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-31 06:04:04       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-31 06:04:04       106 阅读
  3. 在Django里面运行非项目文件

    2024-03-31 06:04:04       87 阅读
  4. Python语言-面向对象

    2024-03-31 06:04:04       96 阅读

热门阅读

  1. JVM八股

    JVM八股

    2024-03-31 06:04:04      40 阅读
  2. vue路由使用

    2024-03-31 06:04:04       43 阅读
  3. 小米汽车:驶向未来的科技新星

    2024-03-31 06:04:04       39 阅读
  4. 专升本-机器人流程化自动化(RPA)

    2024-03-31 06:04:04       38 阅读
  5. Kafka开机自启脚本

    2024-03-31 06:04:04       41 阅读
  6. vector和array区别

    2024-03-31 06:04:04       39 阅读
  7. IPv6 Scapy Samples

    2024-03-31 06:04:04       36 阅读
  8. 2024-03-30 问AI: 介绍一下深度学习里面的 DCNN模型

    2024-03-31 06:04:04       43 阅读