docker基本命令日志
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
容器编排,批量启动?
最新文章
- Mac OS X上搭建伪分布式CDH版本Hadoop开发环境
- 《Entity Framework 6 Recipes》中文翻译系列 (42) ------ 第八章 POCO之使用POCO
- POS机刷卡跨行交易的清算方式
- Activiti保存流程图时diagrms中没有生成png解决办法
- 剔除editor编辑器中的HTML标签
- php基础22:上传并且保存文件
- long long 读数scanf的转换 #define
- C#选择排序详解
- 解决iphone横屏时字体变大问题或者内容大小不一样等
- padding and margin.
- ShopEx访问提示Incompatible file format: The encoded file has format major ID 2, whereas the Loader expects 4
- 超强1000 JQuery插件
- C语言 cgi(3)
- Android Property Animation 物业动画
- LeetCode题解39.Combination Sum
- 2017-2018 ACM-ICPC, Central Europe Regional Contest (CERC 17)
- Tomcat证书安装(pfx和jks)
- 防火墙iptables 设置
- grafana配置
- 《编写可维护的javascript》读书笔记(中)——编程实践
热门文章
- Visual Studio Command Prompt 工具配置方法
- GCD学习(七) dispatch_apply
- Inheritance with EF Code First: Part 1 – Table per Hierarchy (TPH)
- 十三周作业—使用Metaspoit攻击MS08-067
- ROS nodelet 理解记录
- windows10系统连接蓝牙鼠标自动断开解决方案
- [raspberry pi3] 安装ffmpeg
- sqlserver快速删除整个表数据
- json序列化.xml序列化.图片转base64.base64转图片.生成缩略图.IEnumerable<;TResult>; Select<;TSource, TResult>;做数据转换的五种方式
- access + vb + asp 遇到一些问题的总结