docker help
Commands:
attach Attach local standard input, output, and error streams to a running container //重新进入一个运行的容器
build Build an image from a Dockerfile
commit Create a new image from a container's changes //可以自定义一个容器并生成镜像提交
docker commit -a="author" -m="description"  容器id 要创建的目标镜像名:[标签名]
  cp          Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
exec Run a command in a running container
export Export a container's filesystem as a tar archive
history Show the history of an image
images List images //列出本地的镜像
import Import the contents from a tarball to create a filesystem image
info Display system-wide information
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
login Log in to a Docker registry
logout Log out from a Docker registry
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
ps List 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 one or more containers
rm Remove one or more containers //删除容器
rmi Remove one or more images //docker rmi -f 镜像名称
run Run a command in a new container
save Save one or more images to a tar archive (streamed to STDOUT by default)
search Search the Docker Hub for images
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
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
wait Block until one or more containers stop, then print their exit codes Run 'docker COMMAND --help' for more information on a command.

docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
OPTIONS说明:
-a stdin: 指定标准输入输出内容类型,可选 STDIN/STDOUT/STDERR 三项;
-d: 后台运行容器,并返回容器ID;
-i: 以交互模式运行容器,通常与 -t 同时使用;
-p: 端口映射,格式为:主机(宿主)端口:容器端口
-t: 为容器重新分配一个伪输入终端,通常与 -i 同时使用;
--name="nginx-lb": 为容器指定一个名称;
--dns 8.8.8.8: 指定容器使用的DNS服务器,默认和宿主一致;
--dns-search example.com: 指定容器DNS搜索域名,默认和宿主一致;
-h "mars": 指定容器的hostname;
-e username="ritchie": 设置环境变量;
--env-file=[]: 从指定文件读入环境变量;
--cpuset="0-2" or --cpuset="0,1,2": 绑定容器到指定CPU运行;
-m :设置容器使用内存最大值;
--net="bridge": 指定容器的网络连接类型,支持 bridge/host/none/container: 四种类型;
--link=[]: 添加链接到另一个容器;
--expose=[]: 开放一个端口或一组端口;

ctrl+p+q:容器不停止而退出
exit:停止并退出容器
docker attach ...id 重新进入未关闭的容器
docker exec -it  ...id /bin/bash 进入容器并返回一个shell


将宿主机的目录与docker容器中的目录相关联起来,目录挂载:

docker run -it -v /宿主机绝对路径目录:/容器内目录  镜像名 


docker镜像    联合文件系统    以tomcat为例


参考:docker命令大全

docker常用命令理解的更多相关文章

  1. Docker 常用命令和Dockerfile

    Docker 简介 官方的解释为:Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的镜像中,然后发布到任何流行的 Linux或Windows 机器上,也可以实现 ...

  2. [转帖]Docker常用命令总结

    Docker常用命令总结 http://www.ha97.com/5546.html 发表于: Linux, 互联网, 虚拟化与云计算 | 作者: 博客教主 标签: docker,常用命令,总结 PS ...

  3. Docker常用命令速查手册(华贵铂金版)

    原创声明:作者:Arnold.zhao  博客园地址:https://www.cnblogs.com/zh94 Docker常用命令速查手册 搜索仓库镜像 docker search nginx 获取 ...

  4. docker常用命令、镜像命令、容器命令、数据卷,使用dockerFile创建镜像,dockefile的语法规则。

    一.docker常用命令? 1. 常用帮助命令 1.1 docker的信息以及版本号 /* docker info 查看docker的信息 images2 docker本身就是一个镜像. docker ...

  5. 关于Docker 常用命令

    Docker 常用命令 分类列一下常用的CLI命令 仓库相关 search/ pull / push / login etc. 例:docker pull ubuntu 从仓库下载ubuntuimag ...

  6. 【Docker】(3)---linux部署Docker、Docker常用命令

    linux部署Docker.Docker常用命令 本次部署Linux版本:CentOS 7.4 64位. 说明: 因为Docker是基于Linux 64bit的 所以Docker要求64位的系统且内核 ...

  7. Docker常用命令(二)

    Docker常用命令 查看Docker所有正在运行的容器 docker ps 查看Docker已退出的容器 docker ps -a 查看Docker所有镜像 docker images 删除镜像 删 ...

  8. Docker应用二:docker常用命令介绍

     Docker常用命令使用介绍 docker中常用的命令: 1.docker search image_name:搜查镜像 2.docker pull image_name:从镜像库中拉去镜像 3.d ...

  9. Docker常用命令汇总,和常用操作举例

    Docker命令 docker 常用命令如下 管理命令: container 管理容器 image 管理镜像 network 管理网络 node 管理Swarm节点 plugin 管理插件 secre ...

随机推荐

  1. Angular Scope解析与应用

    Scope层级结构 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA== ...

  2. ARM+llinux系统移植3G拨号上网收发短信(二)【转】

    本文转载自:http://blog.csdn.net/hanmengaidudu/article/details/17099749 一.发送text格式的短信 给联通发text格式的短信: ~ > ...

  3. 安装Node.js 以及命令行使用

    安装 官方的安装包 安装完成之后,会自动添加到环境变量中 通过visual studio安装 命令行 查看版本 PS C:\Users\clu\Desktop> node --version v ...

  4. (转载)基于React与Vue后,移动开源项目Weex如何定义未来

    https://www.ctolib.com/topics-106347.html vuejs+ts+webpack2框架的项目实践 https://mp.weixin.qq.com/s/p2Uc9I ...

  5. bzoj [JSOI2010]Group 部落划分 Group【二分+并查集】

    我是zz吗这么简单都写错-- 一眼二分,然后判断的话是枚举点,然后计算这个点到已有联通块的最小距离,如果这个点到一些联通块的距离小于当前二分的val,则把这些联通块合并起来,这里用并查集维护,最后看这 ...

  6. redis 缓存应用

    第1章 部署与安装 wget http://download.redis.io/releases/redis-3.2.10.tar.gz tar xf redis-3.2.10.tar.gz cd r ...

  7. ASP.Net 知识点总结(五)

    1.传入某个属性的set方法的隐含参数的名称是什么?value,它的类型和属性所声名的类型相同.2.如何在C#中实现继承? 在类名后加上一个冒号,再加上基类的名称.3.C#支持多重继承么? 不支持.可 ...

  8. 【洛谷3345_BZOJ3924】[ZJOI2015]幻想乡战略游戏(点分树)

    大概有整整一个月没更博客了 -- 4 月为省选爆肝了一个月,最后压线进 B 队,也算给 NOIP2018 翻车到 316 分压线省一这个折磨了五个月的 debuff 画上了一个不算太差的句号.结果省选 ...

  9. [Offer收割]编程练习赛84 -- 括号序列

    时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定一个只包含'(', ')'和''的字符串S,现在小Hi可以任意指定''为'('或')',不同的'*'可以是不同的字符. ...

  10. 思维+multiset ZOJ Monthly, July 2015 - H Twelves Monkeys

    题目传送门 /* 题意:n个时刻点,m次时光穿梭,告诉的起点和终点,q次询问,每次询问t时刻t之前有多少时刻点是可以通过两种不同的路径到达 思维:对于当前p时间,从现在到未来穿越到过去的是有效的值,排 ...