Commit Graph

24 Commits

Author SHA1 Message Date
Valentin Rothberg dcd2a92e56 use new containers/common/libimage package
Move all code related handling container image over to the new
`libimage` package in containers/common.  The new package is an
attempt to consolidate the code across the containers tools under the
github.com/containers umbrella.

The new `libimage` packages provides functionality to perform all kinds
of operations for managing images such as local lookups, pushing,
pulling, listing, removing, etc.

The following packages have been moved over the containers/common:

`manifests` -> `common/image/manifests`
`pkg/manifests` -> `common/pkg/manifests`
`pkg/supplemented` -> `common/pkg/supplemented`

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-04-22 17:39:00 +02:00
Dan Young a984c8b9a3
Add Tag format placeholder to docs
Also fix spacing on CreatedAt table

Signed-off-by: Dan Young <dyoung@newrelic.com>
2021-03-14 13:38:38 -07:00
Ed Santiago 6c1494c530 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-10-01 04:55:24 -06:00
Sascha Grunert 49e35cb98a Add history names support
The new `buildah images --history` flags shows the history of the names
an image had in the past. If the latest image in the history is equal
the current image's name, then we skip that on from the history for
convenient purposes.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>

Closes: #1998
Approved by: rhatdan
2019-12-05 19:39:33 +00:00
Daniel J Walsh cd88667465 Ran buildah through codespell
Thanks to Dmitry Smirnov @onlyjob for suggesting this tool.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1985
Approved by: TomSweeneyRedHat
2019-11-20 17:38:41 +00:00
Daniel J Walsh 52615463ac Add support for listing read/only images
Also add image fields to json struct.
Cleanup some if then, else if then blocks.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1732
Approved by: @TomSweeneyRedHat
2019-07-19 20:33:34 +00:00
TomSweeneyRedHat 1ef527c81a Add CreatedAtRaw date field for use with Format
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

This adds the ability to see a "raw" date format for the CreatedAt field rather than the pretty formatted variety.

Wit this in place the files will print thusly:

.CreatedAt: "Jan 8, 2019 09:22"
.CreatedAtRaw: "2019-01-08 09:22:52.330623532 -0500 EST"

This hopefully at least partially addresses #1266
Once agreed to, we might want to do a similar thing for buildah containers and then in similar commands in Podman.

Closes: #1269
Approved by: rhatdan
2019-01-09 21:58:15 +00:00
Qi Wang d7e0993090 Add Tag column in images output
Signed-off-by: Qi Wang <qiwan@redhat.com>

Closes: #1170
Approved by: rhatdan
2018-11-16 01:28:47 +00:00
Zhou Hao 08c56308c5 buildah-images.md: Fix option contents
Modify and complete the images function in the notruncate option.

Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>

Closes: #999
Approved by: rhatdan
2018-09-11 13:09:51 +00:00
W. Trevor King a9c12065b3 docs: Follow man-pages(7) suggestions for SYNOPSIS
man-pages(7) has [1]:

> For commands, this shows the syntax of the command and its arguments
> (including options); boldface is used for as-is text and italics are
> used to indicate replaceable arguments. Brackets ([]) surround
> optional arguments, vertical bars (|) separate choices, and ellipses
> (...) can be repeated.

I've adjusted our SYNOPSIS entries to match that formatting, and
generally tried to make them more consistent with the precedent set by
the man-pages project.  Outside of the SYNOPSIS entry, I prefer using
backticks for literals, although in some places I've left the **
bolding to keep things visually similar to a nearby SYNOPSIS entry.

I've also simplified a few placeholders, e.g. "containerID" ->
"container", because I didn't think the additional bit was providing
much additional context.  If there is ambiguity about the
representation, it should be addressed in the DESCRIPTION instead of
with an "ID" or "Name" suffix.

[1]: http://man7.org/linux/man-pages/man7/man-pages.7.html

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #839
Approved by: rhatdan
2018-06-30 10:31:06 +00:00
umohnani8 9018eef97b Add --all,-a flag to buildah images
By default buildah will not show intermediate images created during builds.
When the --a flag is set, buildah will output the intermediate images as well.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #789
Approved by: rhatdan
2018-06-14 14:30:45 +00:00
TomSweeneyRedHat a98be4af90 Touch up images man
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #781
Approved by: rhatdan
2018-06-12 16:01:59 +00:00
Zhou Hao 1501529b38 images: Error if the specified imagename does not exist
The images option allows the image name to be specified. If the specified image does not exist, an error should be output.

Before modification:
```
➜  buildah git:(images-wron-name) sudo buildah images --format {{.ID}} 456
```

After modification:
```
➜  buildah git:(images-wron-name) sudo ./buildah images --format {{.ID}} 456
No such image 456

```

Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>

Closes: #727
Approved by: rhatdan
2018-05-29 15:51:27 +00:00
Daniel J Walsh ca1704fcbb Modify man pages so they compile correctly in mandb
This fixes an issue where if you did
man -k buildah-bud

buildah-bud (1)    - (unknown subject)

Now you will see

man -k buildah-bud
buildah-bud (1)      - Build an image using instructions from Dockerfiles.

More importantly
man -k Dockerfile
buildah-bud (1)      - Build an image using instructions from Dockerfiles.
docker-build (1)     - Build an image from a Dockerfile
docker-image-build (1) - Build an image from a Dockerfile
Dockerfile (5)       - automate the steps of creating a Docker image
podman-build (1)     - Build a container image using a Dockerfile.

Will now list buildah-d

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #638
Approved by: TomSweeneyRedHat
2018-04-26 17:16:23 +00:00
Zhou Hao 5354a288d1 buildah-image: add validation to 'format'
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>

Closes: #605
Approved by: rhatdan
2018-04-20 10:53:57 +00:00
TomSweeneyRedHat 78b0a37293 Change image time to locale, add troubleshooting.md, add logo to other mds
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #544
Approved by: rhatdan
2018-03-30 11:41:45 +00:00
Daniel J Walsh 604fdb0de1 Fix man pages to format correctly
I noticed when you look at the man pages with man ./doc/buildah.1 that the
headings were not showing up.  go-md2man wanted to have a primary header
in order to format them correctly.  Removing the first # from the first line
fixes the issue.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #521
Approved by: rhatdan
2018-03-23 14:06:29 +00:00
umohnani8 85a37b39e8 Add --format and --filter to buildah containers
buildah containers now supports oretty-printing using a Go template
with the --format flag. And output can be filtered based on id, name, or
ancestor.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #437
Approved by: rhatdan
2018-02-02 19:32:06 +00:00
Daniel J Walsh 57a0f38db6 Cleanup buildah-images code
1. Sort options so they are in alphabet order
2. Remove extra lines of code for options parsing that really do not accomplish anything.
3. Remove variables when they are not necessary, I.E. Don't create a variable to hold an
option that is only used once, use the option instead.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #267
Approved by: <username_without_leading_@>
2017-09-26 18:11:26 +00:00
TomSweeneyRedHat bf83bc208d Add quiet description and touch ups
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #233
Approved by: rhatdan
2017-07-30 12:34:36 +00:00
Ryan Cole 6d85cd3f7d update 'buildah images' and 'buildah rmi' commands
add more flags to `buildah images` and `buildah rmi`, and write tests

Signed-off-by: Ryan Cole <rcyoalne@gmail.com>

Closes: #155
Approved by: rhatdan
2017-06-28 15:36:19 +00:00
Brent Baude 62845372ad cmd/buildah/images.go: Add JSON output option
The Atomic CLI will eventually need to be able to consume
structured output (in something like JSON).  This commit
adds a -j option to output to trigger JSON output of
images.

Example output:
```
[
    {
        "id": "aa66247d48aedfa3e9b74e4a41d2c9e5d2529122c8f0d43417012028a66f4f3b",
        "names": [
            "docker.io/library/busybox:latest"
        ]
    },
    {
        "id": "26db5ad6e82d85265d1609e6bffc04331537fdceb9740d36f576e7ee4e8d1be3",
        "names": [
            "docker.io/library/alpine:latest"
        ]
    }
]
```

Signed-off-by: Brent Baude <bbaude@redhat.com>

Closes: #161
Approved by: rhatdan
2017-06-26 16:05:58 +00:00
Nalin Dahyabhai aff92e565c Miscellaneous man page updates
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #67
Approved by: rhatdan
2017-04-14 10:12:01 +00:00
TomSweeneyRedHat 2fe578c82f Create manpages for the buildah project
Second pass of manpages, more tweaking to follow.

Signed-off-by: TomSweeneyRedHat <tsweney@redhat.com>

Closes: #53
Approved by: nalind
2017-04-11 17:22:37 +00:00