2018-03-20 17:41:19 +08:00
|
|
|
# buildah-containers "1" "March 2017" "buildah"
|
2017-03-29 03:37:24 +08:00
|
|
|
|
|
|
|
|
## NAME
|
2018-04-26 21:01:15 +08:00
|
|
|
buildah\-containers - List the working containers and their base images.
|
2017-03-29 03:37:24 +08:00
|
|
|
|
|
|
|
|
## SYNOPSIS
|
2018-06-30 03:39:36 +08:00
|
|
|
**buildah containers** [*options*]
|
2017-03-29 03:37:24 +08:00
|
|
|
|
|
|
|
|
## DESCRIPTION
|
2017-10-26 02:28:51 +08:00
|
|
|
Lists containers which appear to be Buildah working containers, their names and
|
2017-04-14 03:42:04 +08:00
|
|
|
IDs, and the names and IDs of the images from which they were initialized.
|
2017-03-29 03:37:24 +08: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 22:51:19 +08:00
|
|
|
**--all**, **-a**
|
2017-09-22 17:38:31 +08:00
|
|
|
|
|
|
|
|
List information about all containers, including those which were not created
|
2018-01-17 04:26:52 +08:00
|
|
|
by and are not being used by Buildah. Containers created by Buildah are
|
|
|
|
|
denoted with an '*' in the 'BUILDER' column.
|
2017-09-22 17:38:31 +08: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 22:51:19 +08:00
|
|
|
**--filter**, **-f**
|
2018-02-01 03:26:25 +08: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 22:52:51 +08: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 22:51:19 +08:00
|
|
|
**--noheading**, **-n**
|
2017-04-14 03:42:04 +08:00
|
|
|
|
2017-03-29 03:37:24 +08:00
|
|
|
Omit the table headings from the listing of containers.
|
|
|
|
|
|
|
|
|
|
**--notruncate**
|
|
|
|
|
|
2019-09-05 21:24:40 +08:00
|
|
|
Do not truncate IDs and image names in the output.
|
2017-04-14 03:42:04 +08: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 22:51:19 +08:00
|
|
|
**--quiet**, **-q**
|
2017-04-14 03:42:04 +08:00
|
|
|
|
|
|
|
|
Displays only the container IDs.
|
2017-03-29 03:37:24 +08:00
|
|
|
|
|
|
|
|
## EXAMPLE
|
2017-04-14 03:42:04 +08:00
|
|
|
|
|
|
|
|
buildah containers
|
2018-01-16 20:31:32 +08:00
|
|
|
```
|
|
|
|
|
CONTAINER ID BUILDER IMAGE ID IMAGE NAME CONTAINER NAME
|
|
|
|
|
29bdb522fc62 * 3fd9065eaf02 docker.io/library/alpine:latest alpine-working-container
|
|
|
|
|
c6b04237ac8e * f9b6f7f7b9d3 docker.io/library/busybox:latest busybox-working-container
|
|
|
|
|
```
|
2017-04-14 03:42:04 +08:00
|
|
|
|
|
|
|
|
buildah containers --quiet
|
2018-01-16 20:31:32 +08:00
|
|
|
```
|
|
|
|
|
29bdb522fc62d43fca0c1a0f11cfc6dfcfed169cf6cf25f928ebca1a612ff5b0
|
|
|
|
|
c6b04237ac8e9d435ec9cf0e7eda91e302f2db9ef908418522c2d666352281eb
|
|
|
|
|
```
|
2017-04-14 03:42:04 +08:00
|
|
|
|
|
|
|
|
buildah containers -q --noheading --notruncate
|
2018-01-16 20:31:32 +08:00
|
|
|
```
|
|
|
|
|
29bdb522fc62d43fca0c1a0f11cfc6dfcfed169cf6cf25f928ebca1a612ff5b0
|
|
|
|
|
c6b04237ac8e9d435ec9cf0e7eda91e302f2db9ef908418522c2d666352281eb
|
|
|
|
|
```
|
2017-03-29 03:37:24 +08:00
|
|
|
|
2017-06-26 22:52:51 +08:00
|
|
|
buildah containers --json
|
2018-01-16 20:31:32 +08:00
|
|
|
```
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
"id": "29bdb522fc62d43fca0c1a0f11cfc6dfcfed169cf6cf25f928ebca1a612ff5b0",
|
|
|
|
|
"builder": true,
|
|
|
|
|
"imageid": "3fd9065eaf02feaf94d68376da52541925650b81698c53c6824d92ff63f98353",
|
|
|
|
|
"imagename": "docker.io/library/alpine:latest",
|
|
|
|
|
"containername": "alpine-working-container"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "c6b04237ac8e9d435ec9cf0e7eda91e302f2db9ef908418522c2d666352281eb",
|
|
|
|
|
"builder": true,
|
|
|
|
|
"imageid": "f9b6f7f7b9d34113f66e16a9da3e921a580937aec98da344b852ca540aaa2242",
|
|
|
|
|
"imagename": "docker.io/library/busybox:latest",
|
|
|
|
|
"containername": "busybox-working-container"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
```
|
2017-06-26 22:52:51 +08:00
|
|
|
|
2018-02-01 03:26:25 +08:00
|
|
|
buildah containers --format "{{.ContainerID}} {{.ContainerName}}"
|
|
|
|
|
```
|
|
|
|
|
3fbeaa87e583ee7a3e6787b2d3af961ef21946a0c01a08938e4f52d53cce4c04 myalpine-working-container
|
|
|
|
|
fbfd3505376ee639c3ed50f9d32b78445cd59198a1dfcacf2e7958cda2516d5c ubuntu-working-container
|
|
|
|
|
```
|
|
|
|
|
|
2018-04-17 18:46:57 +08:00
|
|
|
buildah containers --format "Container ID: {{.ContainerID}}"
|
|
|
|
|
```
|
|
|
|
|
Container ID: 3fbeaa87e583ee7a3e6787b2d3af961ef21946a0c01a08938e4f52d53cce4c04
|
|
|
|
|
Container ID: fbfd3505376ee639c3ed50f9d32b78445cd59198a1dfcacf2e7958cda2516d5c
|
|
|
|
|
```
|
|
|
|
|
|
2018-02-01 03:26:25 +08: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-29 03:37:24 +08:00
|
|
|
## SEE ALSO
|
|
|
|
|
buildah(1)
|