Skip to main content

Docker: List Containers

Description

Docker: List Containers step is used to get list of containers.

Reference

List containers

Configurations

Field namesDescription
Step NameSpecify a unique step name.
CONNECTION tab:Connection fields
Configuration TypeSelect the configuration type, that is, SSH or SSL-TLS.
Configuration type: SSH
Server NameSpecify the Server Name or IP Address of the server where the Docker daemon is running.
The field data type is String. This field is mandatory.
PortSpecify a valid port.
The field data type is String. This field is mandatory.
UsernameSpecify the valid Username to connect to server or where the Docker Daemon running.
The field data type is String. This field is mandatory.
Accept value as variable/staticLeave checkbox unchecked to accept Password value from a field in the previous steps of the stream using a drop down list. Else enable checkbox for Password field to appear as Text box.
PasswordPassword is entered using a widget. The widget handles both Text (static value or environment variable) and Combo (drop down containing values from previous steps).
The Data Type is String. This field is mandatory.
If checkbox above is enabled Password field appears as Text box and accepts static values or variables. Else if checkbox above is disabled Password field appears as a drop down to select fields from previous steps.
Use KeySelect if you want to use the key. Allowed values are Yes or No.
Private KeySpecify a valid private key path.
BrowseClick to extract the private key path.
PassphraseSpecify a valid passphrase.
Proxy HostSpecify the proxy host or IP address of the proxy host.
Proxy UsernameSpecify a valid proxy user name.
Proxy PasswordSpecify a valid proxy password.
Configuration type: SSL-TLS
Docker Host URISelect a valid Docker Host URI on which Docker Daemon is running.
Note: If you set the DOCKER_HOST then no need to provide the Docker host URI.
CA path (.pem)Select a valid ca.pem (Certificate authority that signed) file path.
Note: If you want to secure your Docker client connections by default, you can move the files to the .docker directory in your home directory, and also set the DOCKER_TLS_VERIFY variables.
BrowseClick to select the ca.pem file path.
Cert Path (.pem)Select valid cert.pem (Client certificate) file path.
BrowseClick to select the cert.pem file path.
Key Path (.pem)Select valid Key.pem (Client key) file path.
BrowseClick to select the key.pem file path.
Test ConnectionVerifies if the connection is established or not.
Note: Test connection verifies if the connection is established or not. Even if the SSL-TLS connection parameters are not provided, the verification of the connection is done based on the settings provided in the connection documentation.
INPUT tab:Input fields
Include All ContainersSelect Yes or No.
If you select 'No' then it will return only running containers, otherwise, it will return all the containers.
Default value: Yes
Output FormatThe formatting output pretty-prints container output using a Go template.
Valid placeholders for the Go template are listed in Additional notes.
Show Last N Created ContainersSelect the value to show last n (Number) created containers.
Default value is -1.
Include Size Of ContainersSelect Yes or No.
Returns the size and virtual size used by the container.
Filters – Get Input FieldsSpecify the filters to process on the container list.
Max Wait For Response (Sec)Specify the amount of time to wait for a response. The default value is 10 sec.
OUTPUT tab:Output fields
Container ListHolds the Containers List on successful plugin execution.
Default value: Container List

Additional notes

  • The filtering format is a key=value pair. If there is more than one filter, then pass multiple values in comma (,) or semicolon (;) separated values. Example, Key=value,key=value;key=value. Available filters are as follows:
FILTERDESCRIPTION
IdContainer’s ID
nameContainer’s name
labelAn arbitrary string representing either a key or a key-value pair.
Expressed as <key> or <key>=<value>.
exitedAn integer representing the container’s exit code. Only useful with Include All Containers equal to yes. Example. exited=0
statusOne of created, restarting, running, removing, paused, exited, or dead. Example: status=created
ancestorFilters containers which share a given image as an ancestor.
Expressed as <image-name>[:<tag>], <image id>, or <image@digest>.
before or sinceFilters containers created before or after a given container ID or name
volumeFilters running containers that have mounted a given volume or bind mount.
networkFilters running containers connected to a given network.
publish or exposeFilters containers which publish or expose a given port. Expressed as <port>[/<proto>] or <startport-endport>/[<proto>]
publish or exposeFilters containers which publish or expose a given port. Expressed as <port>[/<proto>] or <startport-endport>/[<proto>]
isolationWindows daemon only. One of default, process, or hyperv.
is-taskFilters containers that are a “task” for a service. Boolean option (true or false)
  • Output Format Examples: {{.ID}} or {{.ID}}: {{.Command}} or table {{.ID}}\t{{.Labels}}. Following are available Go-Templets:
PlaceholderDescription
.IDContainer ID
.ImageImage ID
.CommandQuoted command
.CreatedAtThe time when the container was created.
.RunningForElapsed time since the container was started.
.PortsExposed ports
.StateContainer status (for example; “created”, “running”, “exited”)
.StatusContainer status with details about duration and health status.
.SizeContainer disk size.
.NamesContainer names.
.LabelsAll labels are assigned to the container.
LabelValue of a specific label for this container. For example '{{.Label "com.docker.swarm.cpu"}}'
.MountsNames of the volumes mounted in this container.
.NetworksNames of the networks attached to this container.