docker help
localhost == 127.0.0.1 == 本机ip
ifconfig 或者 ip addr 查看本地宿主机的ip地址
$ docker help
Usage: docker [OPTIONS] COMMAND [arg...]
docker [ --help | -v | --version ]
A self-sufficient runtime for containers.
Options:
--config=~/.docker Location of client config files
-D, --debug Enable debug mode
-H, --host=[] Daemon socket(s) to connect to
-h, --help Print usage
-l, --log-level=info Set the logging level
--tls Use TLS; implied by --tlsverify
--tlscacert=~/.docker/ca.pem Trust certs signed only by this CA
--tlscert=~/.docker/cert.pem Path to TLS certificate file
--tlskey=~/.docker/key.pem Path to TLS key file
--tlsverify Use TLS and verify the remote
-v, --version Print version information and quit
Commands:
attach Attach to a running container 附着到正在运行的容器
build Build an image from a Dockerfile 从一个Dockerfile构建镜像 -t,为新镜像设置仓库和名称,标签 -f,指定一个区别于标准的Dockerfile的构建源的位置,文件可以不命名为Dockerfile 推荐使用 Dockerfile Dockerfile指令按顺序从上到下执行 Dockerfile每条指令都要是大写字母后面跟一个参数 Dockerfile每条指令都创建一个新的镜像层并对镜像进行提交
commit Create a new image from a container's changes 提交修改过的容器构建一个新的镜像 -m,指定提交信息 -a,作者信息 提交的是容器镜像与当前状态有差异的部分,非常轻量 不推荐使用commit构建镜像
cp Copy files/folders between a container and the local filesystem
create Create a new container 创建一个容器单是并不运行它
diff Inspect changes on a container's filesystem
events Get real time events from the server
exec Run a command in a running container 在正在运行的容器中执行命令 -d,在内部执行后台命令
export Export a container's filesystem as a tar archive
history Show the history of an image 显示镜像使如何被构建出来的历史
images List images 列出docker镜像 image xxx,只查看指定镜像名xxx的镜像 所有镜像都在/var/lib/docker/aufs下或者/var/lib/docker/devicemapper下
import Import the contents from a tarball to create a filesystem image
info Display system-wide information
inspect Return low-level information on a container, image or task 获取容器,镜像,任务的底层详细信息 --format,指定查看结果
kill Kill one or more running containers 快速停止正在运行的容器
load Load an image from a tar archive or STDIN
login Log in to a Docker registry. 登陆到Docker Cloud,需要提前注册账号和密码 个人认证信息保存在¥HOME/.docker/config.json中
logout Log out from a Docker registry.
logs Fetch the logs of a container 获取容器日志 -f,跟踪实时日志 -t,给日志加时间戳 logs --tail 10 -ft,跟踪并获取日志最后10行加时间戳的内容
network Manage Docker networks
node Manage Docker Swarm nodes
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container 查看容器的端口映射或指定端口的映射情况
ps List containers 容器列表 -a,列出所有容器 -l,列出最后使用的容器 ps -n x,显示最后运行的x个容器 所有容器都在/var/lib/docker/containers下
pull Pull an image or a repository from a registry 从库中拉取镜像
push Push an image or a repository to a registry
rename Rename a container
restart Restart a container 重新启动一个容器
rm Remove one or more containers 删除容器 -f,强制删除正在运行的容器 rm ‘docker ps -a -q’,删除所有容器
rmi Remove one or more images
run Run a command in a new container 创建并启动一个新的容器然后运行指定命令 -i,保证容器中STDIN开启 -t,告诉容器分配一个伪tty终端 --name,为容器指定名称 -d,将容器放到后台运行 -c,指定容器中运行的命令 -g,指定容器中运行的命令 -p,Docker运行时开放哪些端口给外部宿主机 宿主机端口可以是随机端口,或指定特定端口,或特定主机的随机端口,或特定主机的特定端口,冒号分割,之前是宿主机之后是Docker容器端口,也可以指定UDP端口 -P,对外公开在Dockerfile中通过EXPOSE指令公开的所有端口,对应的宿主机端口随机选择 --restart=always,自动重启该容器 --restart=on-failure,退出代码非零自动重启 未指定具体镜像标签,则直接下载latest标签镜像
save Save one or more images to a tar archive (streamed to STDOUT by default)
search Search the Docker Hub for images 查找所有Docker Hub上的公共可用镜像
service Manage Docker services
start Start one or more stopped containers 启动一个已经停止的容器
stats Display a live stream of container(s) resource usage statistics 显示容器(s)的资源使用实时统计流
stop Stop one or more running containers 停止正在运行的容器
swarm Manage Docker Swarm
tag Tag an image into a repository
top Display the running processes of a container 查看容器中的进程
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
version Show the Docker version information
volume Manage Docker volumes
wait Block until a container stops, then print its exit code
docker help的更多相关文章
- docker——容器安装tomcat
写在前面: 继续docker的学习,学习了docker的基本常用命令之后,我在docker上安装jdk,tomcat两个基本的java web工具,这里对操作流程记录一下. 软件准备: 1.jdk-7 ...
- Docker笔记一:基于Docker容器构建并运行 nginx + php + mysql ( mariadb ) 服务环境
首先为什么要自己编写Dockerfile来构建 nginx.php.mariadb这三个镜像呢?一是希望更深入了解Dockerfile的使用,也就能初步了解docker镜像是如何被构建的:二是希望将来 ...
- Docker 第一篇--初识docker
已经多年不写博客, 看完<晓松奇谈>最后一期猛然觉醒, 决定仔细梳理下自己这几年的知识脉络. 既然决定写, 那么首先就从最近2年热门的开源项目Docker开始.Docker 这两年在国内很 ...
- 在docker中运行ASP.NET Core Web API应用程序(附AWS Windows Server 2016 widt Container实战案例)
环境准备 1.亚马逊EC2 Windows Server 2016 with Container 2.Visual Studio 2015 Enterprise(Profresianal要装Updat ...
- docker for mac 学习记录
docker基本命令 docker run -d -p 80:80 --name webserver nginx 运行容器并起别名 docker ps 展示目前启动的容器 docker ps -a 展 ...
- scrapy爬虫docker部署
spider_docker 接我上篇博客,为爬虫引用创建container,包括的模块:scrapy, mongo, celery, rabbitmq,连接https://github.com/Liu ...
- [原][Docker]特性与原理解析
Docker特性与原理解析 文章假设你已经熟悉了Docker的基本命令和基本知识 首先看看Docker提供了哪些特性: 交互式Shell:Docker可以分配一个虚拟终端并关联到任何容器的标准输入上, ...
- 开发者的利器:Docker 理解与使用
困扰写代码的机器难免会被我们安装上各种各样的开发工具.语言运行环境和引用库等一大堆的东西,长久以来不仅机器乱七八糟,而且有些相同的软件还有可能会安装不同的版本,这样又会导致一个项目正常运行了,却不小心 ...
- 使用python自动生成docker nginx反向代理配置
由于在测试环境上用docker部署了多个应用,而且他们的端口有的相同,有的又不相同,数量也比较多,在使用jenkins发版本的时候,不好配置,于是想要写一个脚本,能在docker 容器创建.停止的时候 ...
- 微服务与Docker介绍
什么是微服务 微服务应用的一个最大的优点是,它们往往比传统的应用程序更有效地利用计算资源.这是因为它们通过扩展组件来处理功能瓶颈问题.这样一来,开发人员只需要为额外的组件部署计算资源,而不需要部署一个 ...
随机推荐
- 2015年我国IT行业发展趋势分析(转)
中国信息化建设步伐正持续推进,行业和企业信息化应用水平也在不断提高,这使得it技术与应用系统已成为企业日常工作中不可或缺的基础设施.与此同时,用户关注的重心也日益转向it系统的稳定性.系统对生产效率的 ...
- Exchange的AutoDiscover服务
最近工作中涉及到Exchange的AutoDiscover服务,最初想学习后输出一个博客文章.但是最后是找到一篇中文博客文章已经非常清楚的解释了这个问题,如下: http://didda.blog.5 ...
- 理解jquery的$.extend()、$.fn和$.fn.extend()
jQuery为开发插件提拱了两个方法,分别是: jQuery.fn.extend(); jQuery.extend(); jQuery.fn jQuery.fn = jQuery.prototype ...
- 设置XtraForm标题居中
public class CustomFormPainter : FormPainter { public CustomFormPainter(Control owner, DevExpress.Sk ...
- Use setInterval instead of setTimeout
Use setInterval instead of setTimeout check out codes: http://jsfiddle.net/GustvandeWal/295jqqqb/
- 代码安装apk文件
Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); Uri uri = Uri.fromFile(file); in ...
- S5Time BCD码存储
,时基为1秒. 当使用S5TIME时,定义数值的范围为0~999,而且要指明使用的时基.时基指定了时间单位. S5TIME时基及相应的时间范围如下: 时基 BCD码 时间范围 10 ms 00 10 ...
- Map以及Set的遍历(EntrySet方法,补充enumeration和Iterator的区别)
public void mearge(Map map) { Map returnMap = new HashMap<>(); // 转换为Entry Set<Map.Entry< ...
- Zedboard安装桌面系统ubuntu及opencv(1)
最近一直在搞板子,想帮Zedboard安装一个opencv谁知道困难重重,而且网络几乎没有任何资料可以参考,只有陆佳华的<嵌入式软硬件协同设计实战指南>可以参考. 但是这本书讲得不清不楚, ...
- (PHP)程序中如何判断当前用户终端是手机等移动终端
推荐: Mobile-Detect:https://github.com/serbanghita/Mobile-Detect/blob/master/Mobile_Detect.php Detect ...