docker run - Run a command in a new container

启动一个新的容器,一般在docker pull之后首次运行此image

-i 保持stdout打开

-t 打开一个tty

-d 后台运行, 不加-d时运行完可能会自动结束

Ctrl+P+Q 退出tty并保持后台运行

docker start - Start one or more stopped containers

新的容器退出后(比如关机重启了),如果仍然使用docker run xxxx的话,以前的操作内容不会保存。此时可以使用docker start启动历史的容器

上图中使用了两次run mongo, 因此有两个container id, 使用docker start仍能看到历史数据.

docker restart 重启一个运行中的容器

docker exec - Run a command in a running container

容器启动后,使用docker ps获得运行中的容器id,  然后使用docker exec进入此运行中的容器。如果有多个参数,不要加“”

后台运行使用-d, 不是使用&

docker top 显示容器内运行中的进程

docker stats 查看容器内存使用量, 相当于linux shell 中的TOP /iostat

docker commit  -Create a new image from a container's changes

在容器的基础上创建新的image, 可以指定自己的imageName:tag。

docker build 

从DockerFile创建image, DockerFile中可以使用apt|yum安装特定的软件

docker push -Push an image or a repository to a registry

将自己的image推到仓库,方便分享

docker network ls/ inspect 查看桥接后的内网ip

卷挂载 -保存历史数据的另一种方法 https://www.cnblogs.com/lighten/p/6900556.html

容器编排,批量启动?

最新文章

  1. Mac OS X上搭建伪分布式CDH版本Hadoop开发环境
  2. 《Entity Framework 6 Recipes》中文翻译系列 (42) ------ 第八章 POCO之使用POCO
  3. POS机刷卡跨行交易的清算方式
  4. Activiti保存流程图时diagrms中没有生成png解决办法
  5. 剔除editor编辑器中的HTML标签
  6. php基础22:上传并且保存文件
  7. long long 读数scanf的转换 #define
  8. C#选择排序详解
  9. 解决iphone横屏时字体变大问题或者内容大小不一样等
  10. padding and margin.
  11. ShopEx访问提示Incompatible file format: The encoded file has format major ID 2, whereas the Loader expects 4
  12. 超强1000 JQuery插件
  13. C语言 cgi(3)
  14. Android Property Animation 物业动画
  15. LeetCode题解39.Combination Sum
  16. 2017-2018 ACM-ICPC, Central Europe Regional Contest (CERC 17)
  17. Tomcat证书安装(pfx和jks)
  18. 防火墙iptables 设置
  19. grafana配置
  20. 《编写可维护的javascript》读书笔记(中)——编程实践

热门文章

  1. Visual Studio Command Prompt 工具配置方法
  2. GCD学习(七) dispatch_apply
  3. Inheritance with EF Code First: Part 1 – Table per Hierarchy (TPH)
  4. 十三周作业—使用Metaspoit攻击MS08-067
  5. ROS nodelet 理解记录
  6. windows10系统连接蓝牙鼠标自动断开解决方案
  7. [raspberry pi3] 安装ffmpeg
  8. sqlserver快速删除整个表数据
  9. json序列化.xml序列化.图片转base64.base64转图片.生成缩略图.IEnumerable<TResult> Select<TSource, TResult>做数据转换的五种方式
  10. access + vb + asp 遇到一些问题的总结