NAME 名称

podman-start - Start one or more containers
podman-start - 启动一个或多个容器

SYNOPSIS 概要

podman start [options] container
podman start [选项] 容器 ..

podman container start [options] container
podman 容器启动[选项]容器...

DESCRIPTION 描述

Start one or more containers using container IDs or names as input. The attach and interactive options cannot be used to override the --tty and --interactive options from when the container was created. Starting an already running container with the --attach option, Podman simply attaches to the container.
使用容器 ID 或名称作为输入启动一个或多个容器。无法使用 attach 和 interactive 选项来覆盖创建容器时的--tty 和--interactive 选项。使用--attach 选项启动已经运行的容器时,Podman 只是附加到容器。

OPTIONS 选项

--all

Start all the containers, default is only running containers.
启动所有容器,默认仅启动运行中的容器。

--attach, -a

Attach container’s STDOUT and STDERR. The default is false. This option cannot be used when starting multiple containers.
附加容器的 STDOUT 和 STDERR。默认值为 false。在启动多个容器时无法使用此选项。

--detach-keys=sequence --detach-keys=序列

Specify the key sequence for detaching a container. Format is a single character [a-Z] or one or more ctrl-<value> characters where <value> is one of: a-z, @, ^, [, , or _. Specifying “” disables this feature. The default is ctrl-p,ctrl-q.
指定分离容器的键序列。格式为单个字符 [a-Z] 或一个或多个 ctrl-<value> 字符,其中 <value> 是以下之一: a-z@^[,_ 。指定“”将禁用此功能。默认为 ctrl-p,ctrl-q。

This option can also be set in containers.conf(5) file.
此选项也可以在 containers.conf(5) 文件中设置。

--filter, -f

Filter what containers are going to be started from the given arguments. Multiple filters can be given with multiple uses of the --filter flag. Filters with the same key work inclusive with the only exception being label which is exclusive. Filters with different keys always work exclusive.
从给定的参数中筛选要启动的容器。可以使用多个 --filter 标志给出多个过滤器。具有相同键的过滤器与唯一例外 label 一起包含。具有不同键的过滤器始终是互斥的。

Valid filters are listed below:
下面列出了有效的过滤器:

Filter

Description

id

[ID] Container’s ID (CID prefix match by default; accepts regex)
[ID] 容器的 ID(默认情况下是 CID 前缀匹配;接受正则表达式)

name

[Name] Container’s name (accepts regex)
[名称] 容器的名称(接受正则表达式)

label

[Key] or [Key=Value] Label assigned to a container
[键] 或 [键=值] 分配给容器的标签

exited

[Int] Container’s exit code
[整数] 容器的退出代码

status

[Status] Container’s status: ‘created’, ‘exited’, ‘paused’, ‘running’, ‘unknown’
[状态] 容器的状态: '已创建','已退出','已暂停','运行中','未知'

ancestor

[ImageName] Image or descendant used to create container
[镜像名称] 用于创建容器的镜像或后代

before

[ID] or [Name] Containers created before this container
[ID] 或 [名称] 在此容器之前创建的容器

since

[ID] or [Name] Containers created since this container
自创建此容器以来的[ID]或[名称]容器

volume

[VolumeName] or [MountpointDestination] Volume mounted in container
容器中挂载的[VolumeName]或[MountpointDestination]卷

health

[Status] healthy or unhealthy
[状态]健康或不健康

pod

[Pod] name or full or partial ID of pod
[Pod] Pod 的名称或完整或部分 ID

network

[Network] name or full ID of network
[Network] 网络的名称或完整 ID

until

[DateTime] Containers created before the given duration or time.
[日期时间] 在给定持续时间或时间之前创建的容器。

--interactive, -i --交互式, -i ¶

When set to true, keep stdin open even if not attached. The default is false.
当设置为 true 时,即使未连接也保持 stdin 打开。默认值为 false。

--latest, -l

Instead of providing the container name or ID, use the last created container. Note: the last started container can be from other users of Podman on the host machine. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
不要提供容器名称或 ID,而是使用最后创建的容器。注意:最后启动的容器可能来自主机上其他 Podman 用户。(此选项在远程 Podman 客户端中不可用,包括 Mac 和 Windows(不包括 WSL2)主机)

--sig-proxy

Proxy received signals to the container process. SIGCHLD, SIGURG, SIGSTOP, and SIGKILL are not proxied.
代理接收到容器进程的信号。SIGCHLD、SIGURG、SIGSTOP 和 SIGKILL 不会被代理。

The default is true when attaching, false otherwise.
在附加时默认为 true,否则为 false。

EXAMPLE 例子 ¶

Start specified container:
启动指定的容器:

podman start mywebserver

Start multiple containers:
启动多个容器:

podman start 860a4b231279 5421ab43b45

Start specified container in interactive mode with terminal attached:
在交互模式下启动指定容器,并附加终端:

podman start --interactive --attach 860a4b231279

Start last created container in interactive mode (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines):
在交互模式下启动最后创建的容器(此选项不适用于远程 Podman 客户端,包括 Mac 和 Windows(不包括 WSL2)机器):

podman start -i -l

SEE ALSO 参见 ¶

podman(1)

HISTORY 历史 ¶

November 2018, Originally compiled by Brent Baude bbaude@redhat.com
2018 年 11 月,最初由 Brent Baude bbaude@redhat.com 编译