docker help

摘要:
localhost==127.0.0.1==local ipifconfig或ipaddr查看本地主机的IP地址$dockerhelp用法:docker[OPTIONS]COMMAND[arg…]docker[--help |-v |--version]容器的自高效运行时。选项:--config=~/。码头位置

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 推荐使用 DockerfileDockerfile指令按顺序从上到下执行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》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇[IOS微信] 查看微信原始数据(含沙盒中的数据)gcc系列工具 介绍下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

MacBookM1通过DockerDesk安装MySQL8容器

安装好DockerDesk后在preference里面找到DockerEngine将配置改为 { "registry-mirrors": [ "https://registry.docker-cn.com", "http://hub-mirror.c.163.com", "https://docker...

Docker and Kubernetes -- 监控(weave scope)

docker常用的监控工具 weave scope 简介 Weave Scope是Docker和Kubernetes的可视化监控管理软件 Weave Scope 会自动生成容器之间的关系图,方便理解容器之间的关系,也方便监控容器化和微服务化的应用 安装部署 官方安装文档Installing Weave Scope:https://www.weave...

绕过 Docker ,大规模杀死容器

关注「开源Linux」,选择“设为星标” 回复「学习」,有我为您特别筛选的学习资料~ 作者 | Connor Brewster 译者 | Sambodhi 策划 | Tina 要让所有人都能在 Replit 上使用 Web 浏览器编写代码,我们的后端基础设施就是在可抢占的虚拟机上运行。也就是说,运行你代码的计算机可以随时关闭!当这种情况发生时,我们就用...

Docker学习5-Dockerfile编写自己的镜像

前言 Dockerfile 可以自定义编写镜像,简单来说就类似写脚本,shell脚本应该接触不少了,就是一个执行后就完成了。 当然做好的镜像也可以传到镜像仓库,就好像github上面一样存储,一个命令就能照搬下来安装。 一、简介 相信不少朋友会问,为何docker run 一下python就停止了呢?(那执行完了不停止干什么?) 还有为什么我的pip安装,...

Ubuntu18.04安装Docker

由于apt官方库里的docker版本可能比较旧,所以先卸载可能存在的旧版本: $ sudo apt-get remove docker docker-engine docker-ce docker.io 第一种方法从Ubuntu的仓库直接下载安装: 安装比较简单,这种安装的Docker不是最新版本,不过对于学习够用了,依次执行下面命令进行安装。 $ sud...

jenkins pipeline实现自动构建并部署至k8s

在日常开发中,经常会有发布的需求,而且经常会碰到各种环境,比如:开发环境、测试环境、生产环境。虽然可以使用手动构建、上传服务器部署的方式,但在微服务架构下一个项目经常包含多个微服务的部署,如果用手动方式就会非常繁琐而且容易出错。使用jenkins结合SCM可以实现代码的整个自动化构建部署过程。 本文中自动构建部署过程大致完成了以下步骤: 提交spring...