海诗网 知识百科 docker命令(linuxdocker命令)

docker命令(linuxdocker命令)

docker命令, docker下有很多命令,根据其特点一般可以分为容器生命周期管理、容器操作、容器rootfs命令、镜像仓库、本地镜像管理和info|version。详情如下:

Container life cycle management: operation, start/stop/restart, termination, rm, pause/unblock, creation and execution.

Container operations: ps, check, top, attach, event, log, wait, export, port.

Container rootfs commands: submit, cp, difference.

Mirror warehouse: login, pull, push and search.

Local image management: image, rmi, label, construction, history, saving, loading and importing.

Info | Version: Info, Version.

linuxdocker命令

展开:

run命令是什么样的?

docker中的run命令属于创建新容器并运行它的命令。

语法格式:docker run[选项]IMAGE[命令][参数]~]

Selection description:

-a stdin指定标准的输入和输出内容类型,您可以选择三项:STDIN/STDOUT/STDERR。

-d在后台运行容器并返回容器ID。

-i以交互模式运行容器,通常用-t。

-P随机端口映射,容器内部端口随机映射到主机端口。

-p以特定格式指定端口映射:host(主机)port: container port。

-t将一个虚拟输入终端重新分配给容器,通常与-i一起使用。

- name=nginx-lb-lb指定容器的名称。

linuxdocker命令

参考示例:

使用docker镜像nginx:latest在后台模式下启动一个容器,并将容器命名为mynginx。具体命令是:

docker run --name mynginx -d nginx:latest

docker命令,以上就是本文为您收集整理的docker命令最新内容,希望能帮到您!更多相关内容欢迎关注。

本文来自网络,不代表海诗网立场,转载请注明出处:https://www.hallse.com/n/168993.html
      

此网络正在阻止加密的dns流量(苹果隐私警告阻止加密dns)

发表回复
联系我们
联系我们

在线咨询: QQ交谈

邮箱: 3587015498@qq.com

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们
微信扫一扫关注我们
关注微博
返回顶部