directory search
Compose About versions and upgrading (Compose) ASP.NET Core + SQL Server on Linux (Compose) CLI environment variables (Compose) Command-line completion (Compose) Compose(组成) Compose command-line reference(组合命令行参考) Control startup order (Compose) Django and PostgreSQL (Compose) Docker stacks and distributed application bundles (Compose) docker-compose build(docker-compose构建) docker-compose bundle docker-compose config docker-compose create docker-compose down docker-compose events docker-compose exec docker-compose help docker-compose images docker-compose kill docker-compose logs docker-compose pause docker-compose port docker-compose ps docker-compose pull docker-compose push docker-compose restart docker-compose rm docker-compose run docker-compose scale docker-compose start docker-compose stop docker-compose top docker-compose unpause docker-compose up Environment file (Compose) Environment variables in Compose Extend services in Compose Frequently asked questions (Compose) Getting started (Compose) Install Compose Link environment variables (deprecated) (Compose) Networking in Compose Overview of Docker Compose Overview of docker-compose CLI Quickstart: Compose and WordPress Rails and PostgreSQL (Compose) Sample apps with Compose Using Compose in production Using Compose with Swarm Engine .NET Core application (Engine) About images, containers, and storage drivers (Engine) Add nodes to the swarm (Engine) Apply custom metadata (Engine) Apply rolling updates (Engine) apt-cacher-ng Best practices for writing Dockerfiles (Engine) Binaries (Engine) Bind container ports to the host (Engine) Breaking changes (Engine) Build your own bridge (Engine) Configure container DNS (Engine) Configure container DNS in user-defined networks (Engine) CouchDB (Engine) Create a base image (Engine) Create a swarm (Engine) Customize the docker0 bridge (Engine) Debian (Engine) Default bridge network Delete the service (Engine) Deploy a service (Engine) Deploy services to a swarm (Engine) Deprecated Engine features Docker container networking (Engine) Docker overview (Engine) Docker run reference (Engine) Dockerfile reference (Engine) Dockerize an application Drain a node (Engine) Engine FAQ (Engine) Fedora (Engine) Get started (Engine) Get started with macvlan network driver (Engine) Get started with multi-host networking (Engine) How nodes work (Engine) How services work (Engine) Image management (Engine) Inspect the service (Engine) Install Docker (Engine) IPv6 with Docker (Engine) Join nodes to a swarm (Engine) Legacy container links (Engine) Lock your swarm (Engine) Manage nodes in a swarm (Engine) Manage sensitive data with Docker secrets (Engine) Manage swarm security with PKI (Engine) Manage swarm service networks (Engine) Migrate to Engine 1.10 Optional Linux post-installation steps (Engine) Overview (Engine) PostgreSQL (Engine) Raft consensus in swarm mode (Engine) Riak (Engine) Run Docker Engine in swarm mode Scale the service (Engine) SDKs (Engine) Select a storage driver (Engine) Set up for the tutorial (Engine) SSHd (Engine) Storage driver overview (Engine) Store service configuration data (Engine) Swarm administration guide (Engine) Swarm mode key concepts (Engine) Swarm mode overlay network security model (Engine) Swarm mode overview (Engine) Understand container communication (Engine) Use multi-stage builds (Engine) Use swarm mode routing mesh (Engine) Use the AUFS storage driver (Engine) Use the Btrfs storage driver (Engine) Use the Device mapper storage driver (Engine) Use the OverlayFS storage driver (Engine) Use the VFS storage driver (Engine) Use the ZFS storage driver (Engine) Engine: Admin Guide Amazon CloudWatch logs logging driver (Engine) Bind mounts (Engine) Collect Docker metrics with Prometheus (Engine) Configuring and running Docker (Engine) Configuring logging drivers (Engine) Control and configure Docker with systemd (Engine) ETW logging driver (Engine) Fluentd logging driver (Engine) Format command and log output (Engine) Google Cloud logging driver (Engine) Graylog Extended Format (GELF) logging driver (Engine) Journald logging driver (Engine) JSON File logging driver (Engine) Keep containers alive during daemon downtime (Engine) Limit a container's resources (Engine) Link via an ambassador container (Engine) Log tags for logging driver (Engine) Logentries logging driver (Engine) PowerShell DSC usage (Engine) Prune unused Docker objects (Engine) Run multiple services in a container (Engine) Runtime metrics (Engine) Splunk logging driver (Engine) Start containers automatically (Engine) Storage overview (Engine) Syslog logging driver (Engine) tmpfs mounts Troubleshoot volume problems (Engine) Use a logging driver plugin (Engine) Using Ansible (Engine) Using Chef (Engine) Using Puppet (Engine) View a container's logs (Engine) Volumes (Engine) Engine: CLI Daemon CLI reference (dockerd) (Engine) docker docker attach docker build docker checkpoint docker checkpoint create docker checkpoint ls docker checkpoint rm docker commit docker config docker config create docker config inspect docker config ls docker config rm docker container docker container attach docker container commit docker container cp docker container create docker container diff docker container exec docker container export docker container inspect docker container kill docker container logs docker container ls docker container pause docker container port docker container prune docker container rename docker container restart docker container rm docker container run docker container start docker container stats docker container stop docker container top docker container unpause docker container update docker container wait docker cp docker create docker deploy docker diff docker events docker exec docker export docker history docker image docker image build docker image history docker image import docker image inspect docker image load docker image ls docker image prune docker image pull docker image push docker image rm docker image save docker image tag docker images docker import docker info docker inspect docker kill docker load docker login docker logout docker logs docker network docker network connect docker network create docker network disconnect docker network inspect docker network ls docker network prune docker network rm docker node docker node demote docker node inspect docker node ls docker node promote docker node ps docker node rm docker node update docker pause docker plugin docker plugin create docker plugin disable docker plugin enable docker plugin inspect docker plugin install docker plugin ls docker plugin push docker plugin rm docker plugin set docker plugin upgrade docker port docker ps docker pull docker push docker rename docker restart docker rm docker rmi docker run docker save docker search docker secret docker secret create docker secret inspect docker secret ls docker secret rm docker service docker service create docker service inspect docker service logs docker service ls docker service ps docker service rm docker service scale docker service update docker stack docker stack deploy docker stack ls docker stack ps docker stack rm docker stack services docker start docker stats docker stop docker swarm docker swarm ca docker swarm init docker swarm join docker swarm join-token docker swarm leave docker swarm unlock docker swarm unlock-key docker swarm update docker system docker system df docker system events docker system info docker system prune docker tag docker top docker unpause docker update docker version docker volume docker volume create docker volume inspect docker volume ls docker volume prune docker volume rm docker wait Use the Docker command line (Engine) Engine: Extend Access authorization plugin (Engine) Docker log driver plugins Docker network driver plugins (Engine) Extending Engine with plugins Managed plugin system (Engine) Plugin configuration (Engine) Plugins API (Engine) Volume plugins (Engine) Engine: Security AppArmor security profiles for Docker (Engine) Automation with content trust (Engine) Content trust in Docker (Engine) Delegations for content trust (Engine) Deploying Notary (Engine) Docker security (Engine) Docker security non-events (Engine) Isolate containers with a user namespace (Engine) Manage keys for content trust (Engine) Play in a content trust sandbox (Engine) Protect the Docker daemon socket (Engine) Seccomp security profiles for Docker (Engine) Secure Engine Use trusted images Using certificates for repository client verification (Engine) Engine: Tutorials Engine tutorials Network containers (Engine) Get Started Part 1: Orientation Part 2: Containers Part 3: Services Part 4: Swarms Part 5: Stacks Part 6: Deploy your app Machine Amazon Web Services (Machine) Digital Ocean (Machine) docker-machine active docker-machine config docker-machine create docker-machine env docker-machine help docker-machine inspect docker-machine ip docker-machine kill docker-machine ls docker-machine provision docker-machine regenerate-certs docker-machine restart docker-machine rm docker-machine scp docker-machine ssh docker-machine start docker-machine status docker-machine stop docker-machine upgrade docker-machine url Driver options and operating system defaults (Machine) Drivers overview (Machine) Exoscale (Machine) Generic (Machine) Get started with a local VM (Machine) Google Compute Engine (Machine) IBM Softlayer (Machine) Install Machine Machine Machine CLI overview Machine command-line completion Machine concepts and help Machine overview Microsoft Azure (Machine) Microsoft Hyper-V (Machine) Migrate from Boot2Docker to Machine OpenStack (Machine) Oracle VirtualBox (Machine) Provision AWS EC2 instances (Machine) Provision Digital Ocean Droplets (Machine) Provision hosts in the cloud (Machine) Rackspace (Machine) VMware Fusion (Machine) VMware vCloud Air (Machine) VMware vSphere (Machine) Notary Client configuration (Notary) Common Server and signer configurations (Notary) Getting started with Notary Notary changelog Notary configuration files Running a Notary service Server configuration (Notary) Signer configuration (Notary) Understand the service architecture (Notary) Use the Notary client
characters

描述

创建一个新容器

使用

docker container create [OPTIONS] IMAGE [COMMAND] [ARG...]

备选方案

名字,简写

默认

描述

--add-host


添加自定义的主机到IP映射(主机:IP)

--attach, -a


附加到STDIN,STDOUT或STDERR

--blkio-weight

0

阻止IO(相对权重),介于10和1000之间,或0禁用(默认值为0)

--blkio-weight-device


块IO重量(相对设备重量)

--cap-add


添加Linux功能

--cap-drop


删除Linux功能

--cgroup-parent


容器的可选父cgroup

--cidfile


将容器ID写入文件

- -cpu-count

0

CPU数量(仅限Windows)

--cpu-percent

0

CPU百分比(仅限Windows)

--cpu-period

0

限制CPU CFS(完全公平调度程序)期间

--cpu-quota

0

限制CPU CFS(完全公平调度程序)配额

--cpu-rt-period

0

限制CPU实时周期(以微秒为单位)

--cpu-rt-runtime

0

以微秒为单位限制CPU实时运行时间

--cpu-shares,-c

0

CPU份额(相对重量)

--cpus


CPU数量

--cpuset-cpus


允许执行的CPU(0-3,0,1)

--cpuset-mems


允许执行的MEM(0-3,0,1)

--device


将主机设备添加到容器

--device-cgroup-rule


将规则添加到cgroup允许的设备列表

--device-read-bps


限制设备的读取速率(每秒字节数)

--device-read-iops


限制设备的读取速率(每秒IO)

--device-write-bps


限制写入速率(每秒字节数)到设备

--device-write-iops


限制写入速率(每秒IO)到设备

--disable-content-trust

true

跳过图像验证

--dns


设置自定义DNS服务器

--dns-opt


设置DNS选项

--dns-option


设置DNS选项

--dns-search


设置自定义DNS搜索域

--entrypoint


覆盖图像的默认入口点

--env, -e


设置环境变量

--env-file


读入环境变量文件

--expose


公开一个端口或一系列端口

--group-add


添加其他群组加入

--health-cmd


运行以检查运行状况的命令

--health-interval

0

运行检查之间的时间(ms | s | m | h)(默认为0)

--health-retries

0

需要报告不健康的连续失败

--health-start-period

0

启动健康重试倒数前,容器初始化的开始时间段(ms | s | m | h)(默认为0)

--health-timeout

0

允许一次检查运行的最长时间(ms | s | m | h)(默认值为0)

--help

false

打印用法

--hostname,-h


容器主机名称

--init

false

在容器中运行一个转发信号并收集进程的init

--interactive, -i

false

即使没有连接,也要保持STDIN打开

--io-MaxBandwidth

0

系统驱动器的最大IO带宽限制(仅限Windows)

--io-maxiops

0

系统驱动器的最大IOps限制(仅限Windows)

--ip


IPv4地址(例如172.30.100.104)

--ip6


IPv6地址(例如,2001:db8 :: 33)

--ipc


IPC命名空间使用

--isolation


容器隔离技术

--kernel-memory

0

内核内存限制

--label, -l


在容器上设置元数据

--label-file


阅读标签的行分隔文件

--link


将链接添加到其他容器

--link-local-ip


Container IPv4 / IPv6链路本地地址

--log-driver


记录容器的驱动程序

--log-opt


日志驱动选项


--mac-address


容器MAC地址(例如,92:d0:c6:0a:29:33)

--memory, -m

0

内存限制

--memory-reservation

0

内存软限制

--memory-swap

0

交换限制等于内存加交换:'-1'以启用无限交换

--memory-swappiness

-1

调整容器内存swappiness(0到100)

--mount


将文件系统挂载附加到容器

--name


为容器分配一个名称

--net

默认

将容器连接到网络

--network-alias


为容器添加网络范围的别名

--network

默认

将容器连接到网络

--network-alias


为容器添加网络范围的别名

--no-healthcheck

false

禁用任何容器指定的HEALTHCHECK

--oom-kill-disable

fase

禁用OOM杀手

--oom-score-adj

0

调整主机的OOM首选项(从-1000到1000)

--pid


要使用的PID名称空间

--pids-limit

0

调整容器匹配限制(无限制地设置-1)

--privileged

false

给这个容器赋予扩展权限

--publish,-p


将容器的端口发布到主机

--publish-all,-P

false

将所有暴露的端口发布到随机端口

--read-only

false

将容器的根文件系统挂载为只读

--restart

none

重新启动策略以在容器退出时应用

--rm

false

当容器退出时自动移除容器

--runtime


运行时用于此容器

--security-OPT


安全选项

--shm-size

0

/ dev / shm的大小

--stop-signal

SIGTERM

停止容器的信号

- --stop-signal

0

超时(以秒为单位)停止容器

--storage-OPT


容器的存储驱动程序选项

--sysctl

map[]

Sysctl选项

--tmpfs


挂载一个tmpfs目录

--tty, -t

false

分配一个伪TTY

--ulimit


Ulimit选项

--user,-u


用户名或UID(格式:<名称| uid>:<组| gid>)

--userns


要使用的用户名称空间

--uts


UTS命名空间使用

--volume, -v


绑定安装一个卷

--volume-driver


容器的可选卷驱动程序

--volumes-from


从指定容器装载卷

--workdir, -w


容器内的工作目录

父命令

命令

描述

docker container

管理容器

相关命令

命令

描述

docker container attach

将本地标准输入,输出和错误流附加到正在运行的容器

docker container commit

根据容器的更改创建新图像

docker container cp

复制容器和本地文件系统之间的文件/文件夹

docker container create

创建一个新的容器

docker container diff

检查对容器文件系统上文件或目录的更改

docker container exec

在正在运行的容器中运行命令

docker container export

将容器的文件系统导出为tar存档

docker container inspect

显示一个或多个容器的详细信息

docker container kill

杀死一个或多个正在运行的容器

docker container logs

获取容器的日志

docker container ls

列出容器

docker container pause

暂停一个或多个容器内的所有进程

docker container port

列出容器的端口映射或特定映射

docker container prune

删除所有停止的容器

docker container rename

重命名一个容器

docker container restart

重新启动一个或多个容器

docker container rm

删除一个或多个容器

docker container run

在新容器中运行命令

docker container start

启动一个或多个停止的容器

docker container stats

显示容器资源使用统计信息的实时流

docker container stop

停止一个或多个运行容器

docker container top

显示容器的运行过程

docker container unpause

取消暂停一个或多个容器内的所有进程

docker container update

更新一个或多个容器的配置

docker container wait

阻塞,直到一个或多个容器停止,然后打印退出代码

Previous article: Next article: