2018-03-20 05:41:19 -04:00
|
|
|
# buildah-containers "1" "March 2017" "buildah"
|
2017-03-28 15:37:24 -04:00
|
|
|
|
|
|
|
|
## NAME
|
2018-04-26 09:01:15 -04:00
|
|
|
buildah\-containers - List the working containers and their base images.
|
2017-03-28 15:37:24 -04:00
|
|
|
|
|
|
|
|
## SYNOPSIS
|
2018-06-29 12:39:36 -07:00
|
|
|
**buildah containers** [*options*]
|
2017-03-28 15:37:24 -04:00
|
|
|
|
|
|
|
|
## DESCRIPTION
|
2017-10-25 18:28:51 +00:00
|
|
|
Lists containers which appear to be Buildah working containers, their names and
|
2017-04-13 15:42:04 -04:00
|
|
|
IDs, and the names and IDs of the images from which they were initialized.
|
2017-03-28 15:37:24 -04:00
|
|
|
|
|
|
|
|
## OPTIONS
|
|
|
|
|
|
New CI check: xref --help vs man pages
Run 'buildah --help', recursively against all subcommands,
then cross-reference the results against docs/buildah*.md.
Report differences in subcommands and/or flags.
The majority of the changes in this PR are trivial (see
below) but a handful may be controversial and require
careful review:
* Making 'bud' the default output of 'buildah help',
with 'build-using-dockerfile' as an alias. This is
the inverse of the situation until now: buildah
would list build-using-dockerfile as the primary
name. The man page, OTOH, lists 'bud'. The source
file name is 'bud'. I suspect that most people
type 'bud'. So, for consistency, I choose to make
'bud' the default visible command.
* add --encryption-key and --encrypt-layer documentation
to buildah-commit.md, and --encrypt-layer to -push.md.
Please double-check the wording here.
* remove --notruncate from buildah-images.md. The option
does not exist (although there is a TODO comment in
the code). If it should exist, it is left to the
reader to implement. I would humbly suggest that this
is a good idea, for consistency with buildah containers.
* remove --shm-size from buildah-pull.md. The option
does not exist, and I suspect this was a copy-paste error.
* remove --security-opt from run.go. It was unimplemented
and undocumented.
* remove --userns-[gu]id-map from buildah-bud.md. These
are global options, not bud options, and are documented
well enough in buildah.bud.
Trivial (IMO) changes:
* split options in man pages, from '**--foo, -f**'
to '**--foo**, **-f**'. This conforms with the style
used in podman man pages.
* add missing one-letter aliases (usually "-q", "-a")
* add missing man page entries for some easy options
* sort out-of-order subcommand listings in man pages
Finally, do note that this is a copy-and-alter duplicate of the
original script in podman, and that is horrible. In an ideal
world I would've been able to refactor the podman version into
something usable on both repos (and then more). It turns out the
differences in man page format and in special-case handling are
too broad to let me do a clean refactor.
Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-21 08:51:19 -06:00
|
|
|
**--all**, **-a**
|
2017-09-22 09:38:31 +00:00
|
|
|
|
|
|
|
|
List information about all containers, including those which were not created
|
2018-01-16 15:26:52 -05:00
|
|
|
by and are not being used by Buildah. Containers created by Buildah are
|
|
|
|
|
denoted with an '*' in the 'BUILDER' column.
|
2017-09-22 09:38:31 +00:00
|
|
|
|
New CI check: xref --help vs man pages
Run 'buildah --help', recursively against all subcommands,
then cross-reference the results against docs/buildah*.md.
Report differences in subcommands and/or flags.
The majority of the changes in this PR are trivial (see
below) but a handful may be controversial and require
careful review:
* Making 'bud' the default output of 'buildah help',
with 'build-using-dockerfile' as an alias. This is
the inverse of the situation until now: buildah
would list build-using-dockerfile as the primary
name. The man page, OTOH, lists 'bud'. The source
file name is 'bud'. I suspect that most people
type 'bud'. So, for consistency, I choose to make
'bud' the default visible command.
* add --encryption-key and --encrypt-layer documentation
to buildah-commit.md, and --encrypt-layer to -push.md.
Please double-check the wording here.
* remove --notruncate from buildah-images.md. The option
does not exist (although there is a TODO comment in
the code). If it should exist, it is left to the
reader to implement. I would humbly suggest that this
is a good idea, for consistency with buildah containers.
* remove --shm-size from buildah-pull.md. The option
does not exist, and I suspect this was a copy-paste error.
* remove --security-opt from run.go. It was unimplemented
and undocumented.
* remove --userns-[gu]id-map from buildah-bud.md. These
are global options, not bud options, and are documented
well enough in buildah.bud.
Trivial (IMO) changes:
* split options in man pages, from '**--foo, -f**'
to '**--foo**, **-f**'. This conforms with the style
used in podman man pages.
* add missing one-letter aliases (usually "-q", "-a")
* add missing man page entries for some easy options
* sort out-of-order subcommand listings in man pages
Finally, do note that this is a copy-and-alter duplicate of the
original script in podman, and that is horrible. In an ideal
world I would've been able to refactor the podman version into
something usable on both repos (and then more). It turns out the
differences in man page format and in special-case handling are
too broad to let me do a clean refactor.
Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-21 08:51:19 -06:00
|
|
|
**--filter**, **-f**
|
2018-01-31 14:26:25 -05:00
|
|
|
|
|
|
|
|
Filter output based on conditions provided.
|
|
|
|
|
|
|
|
|
|
Valid filters are listed below:
|
|
|
|
|
|
|
|
|
|
| **Filter** | **Description** |
|
|
|
|
|
| --------------- | ------------------------------------------------------------------- |
|
|
|
|
|
| id | [ID] Container's ID |
|
|
|
|
|
| name | [Name] Container's name |
|
|
|
|
|
| ancestor | [ImageName] Image or descendant used to create container |
|
|
|
|
|
|
|
|
|
|
**--format**
|
|
|
|
|
|
|
|
|
|
Pretty-print containers using a Go template.
|
|
|
|
|
|
|
|
|
|
Valid placeholders for the Go template are listed below:
|
|
|
|
|
|
|
|
|
|
| **Placeholder** | **Description** |
|
|
|
|
|
| --------------- | -----------------------------------------|
|
|
|
|
|
| .ContainerID | Container ID |
|
|
|
|
|
| .Builder | Whether container was created by buildah |
|
|
|
|
|
| .ImageID | Image ID |
|
|
|
|
|
| .ImageName | Image name |
|
|
|
|
|
| .ContainerName | Container name |
|
|
|
|
|
|
2017-06-26 09:52:51 -05:00
|
|
|
**--json**
|
|
|
|
|
|
|
|
|
|
Output in JSON format.
|
|
|
|
|
|
New CI check: xref --help vs man pages
Run 'buildah --help', recursively against all subcommands,
then cross-reference the results against docs/buildah*.md.
Report differences in subcommands and/or flags.
The majority of the changes in this PR are trivial (see
below) but a handful may be controversial and require
careful review:
* Making 'bud' the default output of 'buildah help',
with 'build-using-dockerfile' as an alias. This is
the inverse of the situation until now: buildah
would list build-using-dockerfile as the primary
name. The man page, OTOH, lists 'bud'. The source
file name is 'bud'. I suspect that most people
type 'bud'. So, for consistency, I choose to make
'bud' the default visible command.
* add --encryption-key and --encrypt-layer documentation
to buildah-commit.md, and --encrypt-layer to -push.md.
Please double-check the wording here.
* remove --notruncate from buildah-images.md. The option
does not exist (although there is a TODO comment in
the code). If it should exist, it is left to the
reader to implement. I would humbly suggest that this
is a good idea, for consistency with buildah containers.
* remove --shm-size from buildah-pull.md. The option
does not exist, and I suspect this was a copy-paste error.
* remove --security-opt from run.go. It was unimplemented
and undocumented.
* remove --userns-[gu]id-map from buildah-bud.md. These
are global options, not bud options, and are documented
well enough in buildah.bud.
Trivial (IMO) changes:
* split options in man pages, from '**--foo, -f**'
to '**--foo**, **-f**'. This conforms with the style
used in podman man pages.
* add missing one-letter aliases (usually "-q", "-a")
* add missing man page entries for some easy options
* sort out-of-order subcommand listings in man pages
Finally, do note that this is a copy-and-alter duplicate of the
original script in podman, and that is horrible. In an ideal
world I would've been able to refactor the podman version into
something usable on both repos (and then more). It turns out the
differences in man page format and in special-case handling are
too broad to let me do a clean refactor.
Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-21 08:51:19 -06:00
|
|
|
**--noheading**, **-n**
|
2017-04-13 15:42:04 -04:00
|
|
|
|
2017-03-28 15:37:24 -04:00
|
|
|
Omit the table headings from the listing of containers.
|
|
|
|
|
|
|
|
|
|
**--notruncate**
|
|
|
|
|
|
2019-09-05 15:24:40 +02:00
|
|
|
Do not truncate IDs and image names in the output.
|
2017-04-13 15:42:04 -04:00
|
|
|
|
New CI check: xref --help vs man pages
Run 'buildah --help', recursively against all subcommands,
then cross-reference the results against docs/buildah*.md.
Report differences in subcommands and/or flags.
The majority of the changes in this PR are trivial (see
below) but a handful may be controversial and require
careful review:
* Making 'bud' the default output of 'buildah help',
with 'build-using-dockerfile' as an alias. This is
the inverse of the situation until now: buildah
would list build-using-dockerfile as the primary
name. The man page, OTOH, lists 'bud'. The source
file name is 'bud'. I suspect that most people
type 'bud'. So, for consistency, I choose to make
'bud' the default visible command.
* add --encryption-key and --encrypt-layer documentation
to buildah-commit.md, and --encrypt-layer to -push.md.
Please double-check the wording here.
* remove --notruncate from buildah-images.md. The option
does not exist (although there is a TODO comment in
the code). If it should exist, it is left to the
reader to implement. I would humbly suggest that this
is a good idea, for consistency with buildah containers.
* remove --shm-size from buildah-pull.md. The option
does not exist, and I suspect this was a copy-paste error.
* remove --security-opt from run.go. It was unimplemented
and undocumented.
* remove --userns-[gu]id-map from buildah-bud.md. These
are global options, not bud options, and are documented
well enough in buildah.bud.
Trivial (IMO) changes:
* split options in man pages, from '**--foo, -f**'
to '**--foo**, **-f**'. This conforms with the style
used in podman man pages.
* add missing one-letter aliases (usually "-q", "-a")
* add missing man page entries for some easy options
* sort out-of-order subcommand listings in man pages
Finally, do note that this is a copy-and-alter duplicate of the
original script in podman, and that is horrible. In an ideal
world I would've been able to refactor the podman version into
something usable on both repos (and then more). It turns out the
differences in man page format and in special-case handling are
too broad to let me do a clean refactor.
Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-21 08:51:19 -06:00
|
|
|
**--quiet**, **-q**
|
2017-04-13 15:42:04 -04:00
|
|
|
|
|
|
|
|
Displays only the container IDs.
|
2017-03-28 15:37:24 -04:00
|
|
|
|
|
|
|
|
## EXAMPLE
|
2017-04-13 15:42:04 -04:00
|
|
|
|
|
|
|
|
buildah containers
|
2018-01-16 07:31:32 -05:00
|
|
|
```
|
|
|
|
|
CONTAINER ID BUILDER IMAGE ID IMAGE NAME CONTAINER NAME
|
2021-10-09 08:26:55 -04:00
|
|
|
ccf84de04b80 * 53ce4390f2ad registry.access.redhat.com/ub... ubi8-working-container
|
|
|
|
|
45be1d806fc5 * 16ea53ea7c65 docker.io/library/busybox:latest busybox-working-container
|
2018-01-16 07:31:32 -05:00
|
|
|
```
|
2017-04-13 15:42:04 -04:00
|
|
|
|
|
|
|
|
buildah containers --quiet
|
2018-01-16 07:31:32 -05:00
|
|
|
```
|
2021-10-09 08:26:55 -04:00
|
|
|
ccf84de04b80c309ce6586997c79a769033dc4129db903c1882bc24a058438b8
|
|
|
|
|
45be1d806fc533fcfc2beee77e424d87e5990d3ce9214d6b374677d6630bba07
|
2018-01-16 07:31:32 -05:00
|
|
|
```
|
2017-04-13 15:42:04 -04:00
|
|
|
|
|
|
|
|
buildah containers -q --noheading --notruncate
|
2018-01-16 07:31:32 -05:00
|
|
|
```
|
2021-10-09 08:26:55 -04:00
|
|
|
ccf84de04b80c309ce6586997c79a769033dc4129db903c1882bc24a058438b8
|
|
|
|
|
45be1d806fc533fcfc2beee77e424d87e5990d3ce9214d6b374677d6630bba07
|
2018-01-16 07:31:32 -05:00
|
|
|
```
|
2017-03-28 15:37:24 -04:00
|
|
|
|
2017-06-26 09:52:51 -05:00
|
|
|
buildah containers --json
|
2018-01-16 07:31:32 -05:00
|
|
|
```
|
|
|
|
|
[
|
|
|
|
|
{
|
2021-10-09 08:26:55 -04:00
|
|
|
"id": "ccf84de04b80c309ce6586997c79a769033dc4129db903c1882bc24a058438b8",
|
2018-01-16 07:31:32 -05:00
|
|
|
"builder": true,
|
2021-10-09 08:26:55 -04:00
|
|
|
"imageid": "53ce4390f2adb1681eb1a90ec8b48c49c015e0a8d336c197637e7f65e365fa9e",
|
|
|
|
|
"imagename": "registry.access.redhat.com/ubi8:latest",
|
|
|
|
|
"containername": "ubi8-working-container"
|
2018-01-16 07:31:32 -05:00
|
|
|
},
|
|
|
|
|
{
|
2021-10-09 08:26:55 -04:00
|
|
|
"id": "45be1d806fc533fcfc2beee77e424d87e5990d3ce9214d6b374677d6630bba07",
|
2018-01-16 07:31:32 -05:00
|
|
|
"builder": true,
|
2021-10-09 08:26:55 -04:00
|
|
|
"imageid": "16ea53ea7c652456803632d67517b78a4f9075a10bfdc4fc6b7b4cbf2bc98497",
|
2018-01-16 07:31:32 -05:00
|
|
|
"imagename": "docker.io/library/busybox:latest",
|
|
|
|
|
"containername": "busybox-working-container"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
```
|
2017-06-26 09:52:51 -05:00
|
|
|
|
2018-01-31 14:26:25 -05:00
|
|
|
buildah containers --format "{{.ContainerID}} {{.ContainerName}}"
|
|
|
|
|
```
|
2021-10-09 08:26:55 -04:00
|
|
|
ccf84de04b80c309ce6586997c79a769033dc4129db903c1882bc24a058438b8 ubi8-working-container
|
|
|
|
|
45be1d806fc533fcfc2beee77e424d87e5990d3ce9214d6b374677d6630bba07 busybox-working-container
|
2018-01-31 14:26:25 -05:00
|
|
|
```
|
|
|
|
|
|
2018-04-17 18:46:57 +08:00
|
|
|
buildah containers --format "Container ID: {{.ContainerID}}"
|
|
|
|
|
```
|
2021-10-09 08:26:55 -04:00
|
|
|
Container ID: ccf84de04b80c309ce6586997c79a769033dc4129db903c1882bc24a058438b8
|
|
|
|
|
Container ID: 45be1d806fc533fcfc2beee77e424d87e5990d3ce9214d6b374677d6630bba07
|
2018-04-17 18:46:57 +08:00
|
|
|
```
|
|
|
|
|
|
2018-01-31 14:26:25 -05:00
|
|
|
buildah containers --filter ancestor=ubuntu
|
|
|
|
|
```
|
|
|
|
|
CONTAINER ID BUILDER IMAGE ID IMAGE NAME CONTAINER NAME
|
|
|
|
|
fbfd3505376e * 0ff04b2e7b63 docker.io/library/ubuntu:latest ubuntu-working-container
|
|
|
|
|
```
|
|
|
|
|
|
2017-03-28 15:37:24 -04:00
|
|
|
## SEE ALSO
|
|
|
|
|
buildah(1)
|