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介绍
什么是微服务 微服务应用的一个最大的优点是,它们往往比传统的应用程序更有效地利用计算资源.这是因为它们通过扩展组件来处理功能瓶颈问题.这样一来,开发人员只需要为额外的组件部署计算资源,而不需要部署一个 ...
随机推荐
- Exchange的AutoDiscover服务
最近工作中涉及到Exchange的AutoDiscover服务,最初想学习后输出一个博客文章.但是最后是找到一篇中文博客文章已经非常清楚的解释了这个问题,如下: http://didda.blog.5 ...
- jquery checkbox的相关操作——全选、反选、获得所有选中的checkbox
1.全选 $("#btn1").click(function(){ $("input[name='checkbox']").attr("checked ...
- 在Chrome+Visual Studio中调试asp.net程序很慢的问题(Firefox也有类似问题)
在Chrome+Visual Studio中调试asp.net程序很慢的问题(Firefox也有类似问题) 今天开始起在Chrome中调试,发现问题主要出在菜单栏(layout文件)中,google了 ...
- C#防止反编译
http://blog.csdn.net/wangpei421/article/details/42393095 http://www.cnblogs.com/tianguook/archive/20 ...
- H5页面在QQ和微信上分享,为什么不能自定义设置图片和摘要?
[记录]title标签中的页面标题为抓取标题.body内第一个img标签内的图片为自动抓取缩略图,图片宽高要大于300,如果不希望显示出来,将标签宽高皆设置为0.摘要显示为来源链接,如需自定义需要通过 ...
- Python内存数据库/引擎
1 初探 在平时的开发工作中,我们可能会有这样的需求:我们希望有一个内存数据库或者数据引擎,用比较Pythonic的方式进行数据库的操作(比如说插入和查询). 举个具体的例子,分别向数据库db中插入两 ...
- centos 7安装部署docker
1.centos 7 在windows下通过vm虚拟机安装centos 7: VMware-workstation-full-10.0.3-1895310 centos 7 2.要求 操作系统的内核版 ...
- Lab_6_SysOps_AutoScaling_Linux_v2.5
System Operations - Lab 6: Using Amazon Elastic Load Balancer (Linux) - 2.5 ======================== ...
- Hibernate反向工程生成DAO
通过Hibernate反向工程生成个DAO: package dao; import java.util.List; import org.hibernate.LockMode; import org ...
- createjs easal.js制作了一个很简单的链路图
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...