Commit Graph

42 Commits

Author SHA1 Message Date
Valentin Rothberg 2426782335 [CI:DOCS] push/pull: clarify supported transports
As pointed out in containers/podman/issues/10730, the man pages of
buildah/podman push/pull were incomplete in explaining all supported
transports.  To keep things simple, explain the defaults, refer to
containers-transports(5).

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-23 10:35:06 +02:00
Miloslav Trmač 2e8668b591 Fix documentation of the --format option of buildah push
It affects all transports; and without --format, we try several manifest formats.

[NO NEW TESTS NEEDED]

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-06-17 20:11:32 +02:00
Daniel J Walsh b58b31aaf2
Document location of auth.json file if XDG_RUNTIME_DIR is not set
Fixes: https://github.com/containers/buildah/issues/3189

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-29 15:37:23 -04:00
Daniel J Walsh 6f59942fc7
[ci:docs] Fix man page for buildah push
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-31 05:27:25 -05:00
OpenShift Merge Robot 10c10eedd2
Merge pull request #2895 from rhatdan/push
Make buildah push support pushing manifests lists and digests
2021-01-08 08:44:41 -05:00
Daniel J Walsh 57dde8e977
Make buildah push support pushing manifests lists and digests
Currently manifests just look like images in container storage.
It is surprising to the user when they go to push the images
that they end up failing, and have to use the buildah manifest push.

This patch causes buildah push to failover to buildah manifest push
if the image is a manifest.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-08 06:36:11 -05:00
Daniel J Walsh 7acdfe8e8d
Add support for --manifest flags
This patch allows users to build a multi arch image with simple commands
using emulation software.

```
buildah bud --arch arm --manifest myimage /tmp/mysrc
buildah bud --arch amd64 --manifest myimage /tmp/mysrc
buildah bud --arch s390x --manifest myimage /tmp/mysrc
```

And something like this for buildah commit
```
build() {
	ctr=$(./bin/buildah from --arch $1 ubi8)
	./bin/buildah run $ctr dnf install -y iputils
	./bin/buildah commit --manifest ubi8ping $ctr
}
build arm
build amd64
build s390x
```

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-07 14:41:02 -05:00
Qi Wang 2ddc22c2dd Skip tlsVerify insecure BUILD_REGISTRY_SOURCES
If the registry is set to insecure allowd using BUILD_REGISTRY_SOURCES, hardcode to skip the tls verify to avoid the errors.
Returns error if set insecureRegistries but force to use tls-verify.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-10-13 15:57:42 -04: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
Flavio Castelli 64e95b0926
Uniform some man pages
Small fixes to the man pages:

  * Ensure the explaination of the `--cert-dir` and `--tls-verify` flags
    are consistent across all the commands.
  * Ensure `buildah-login` and `docker-login` man pages are referenced
    by the sub commands that deal with authenticated registries.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2020-09-10 10:04:40 +02:00
Brandon Lum 0ee5ea325a Updated docs
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2020-05-18 21:27:24 +00:00
Brandon Lum 37df2b9690 implementation of encrypt/decrypt push/pull/bud/from
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2020-05-18 21:27:23 +00:00
Nalin Dahyabhai a925f79cc3 add --sign-by to bud/commit/push, --remove-signatures for pull/push
Add the --sign-by option to `buildah build-using-dockerfile`,
`buildah commit`, `buildah push`, and `buildah manifest push`.  Add the
`--remove-signatures` option to `buildah pull`, `buildah push`, and
`buildah manifest push`.  We just pass them to the image library, which
does all of the heavy lifting.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #2085
Approved by: rhatdan
2020-01-17 18:22:34 +00:00
Ed Santiago b555b7dfc6 docs: fix references to containers-*.5
Fix man page instances of 'registries.conf(5)' et al.
The correct man page is containers-registries.conf(5).

Found via:

  $ for i in registries.conf storage.conf policy.json ; do grep $i.5 docs/*.md | grep -v containers-$i;done

In buildah.md, I simply removed the storage.conf line from
the 'Commands' table because it's not a command.

Signed-off-by: Ed Santiago <santiago@redhat.com>

Closes: #2068
Approved by: TomSweeneyRedHat
2020-01-08 02:45:01 +00:00
Daniel J Walsh e53fc16b9f
Set the TMPDIR for pulling/pushing image to $TMPDIR
Or set it to /var/tmp if the user did not specify.

Currently certain large workloads can not be handled because users are running
out of space on pulls/ and pushes.  Containers/image stores data temporarily in
the file system.  This allows the user to overide the location of the temporary
storage.

Also update containers/image to v5.0.1

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-12-18 14:33:15 -05: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
Giuseppe Scrivano 8a23247ce9
build: drop support for ostree
it is going to be removed from containers/image as well, so no longer
depend on it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-10-30 10:49:58 +01:00
Nalin Dahyabhai 0bb4f3112c pull/commit/push: pay attention to $BUILD_REGISTRY_SOURCES
If $BUILD_REGISTRY_SOURCES is set, expect it to be a valid
github.com/openshift/api/config/v1.Image, and parse its
AllowedRegistries and BlockedRegistries lists when, pulling, committing,
or pushing images.

Override the local signature policy when committing or pushing an image
to ensure that local storage is always allowed.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #1787
Approved by: rhatdan
2019-08-29 18:42:16 +00:00
TomSweeneyRedHat 51415ec68e Add --digestfile and Re-add push statement as debug
We removed the "Succesfully pushed ..." statement from the end of
the `buildah push` command in #1744.  However we've had a request
for that information still so I'm re-adding it as a debug statement
and we can discuss if there's a better way or not.

Also add the --digestfile option.  With it the user will be able
to specify a file to write the digest of the pushed image to for
reference.

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

Closes: #1799
Approved by: rhatdan
2019-08-19 18:14:16 +00:00
Qi Wang 59da11d4b4 add buildah login/logout & fix authfile path
Fix the bug that buildah reads /var/run/containers.. as authentication file.(in readme files it should be /run/containers/uid).
Add `buildah login`, `buildah logout` to close #1329, enable to use buildah login before running buildah bud for multi-stage bud and avoiding using --creds flag.

Signed-off-by: Qi Wang <qiwan@redhat.com>

Closes: #1501
Approved by: rhatdan
2019-05-02 21:59:12 +00:00
Daniel J Walsh 11dd2197df Hide from users command options that we don't want them to use.
We really want users to use the registries.conf file specified by
the administrator. We also don't want them overriding the signature-policy.
Thes options are mainly their for CI/CD Systems, so they should be hidden
from the user.

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

Closes: #1373
Approved by: TomSweeneyRedHat
2019-03-04 13:32:24 +00:00
TomSweeneyRedHat 5cca1d6059 Clarify docker.io default in push with docker-daemon
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #1221
Approved by: rhatdan
2018-12-05 18:42:09 +00:00
Jonh Wendell 3aa2dccace Push: Allow an empty destination
In this case assume it's the same as source. This makes it
compatible with `docker push`.

Thus `buildah push my_registry/my_image` will behave like
`buildah push my_registry/my_image docker://my_registry/my_image`

Signed-off-by: Jonh Wendell <jonh.wendell@redhat.com>

Closes: #994
Approved by: rhatdan
2018-09-13 20:10:45 +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
TomSweeneyRedHat 94c1e6dd68 Change 'registries' to 'container registries' in man
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #774
Approved by: rhatdan
2018-06-11 14:10:56 +00:00
TomSweeneyRedHat 0ae62e326a Touchup man page short options across man pages
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #675
Approved by: rhatdan
2018-05-11 16:23:15 +00:00
TomSweeneyRedHat 45772e84e4 Add Files section with registries.conf to pertinent man pages
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #653
Approved by: rhatdan
2018-05-04 11:54:07 +00:00
Nalin Dahyabhai 44468f811c Force "localhost" as a default registry
Extend util.ResolveName() to prepend "localhost" to the list of
registries, and teach util.FindImage(), util.ExpandNames(), and
util.AddImageNames() to use util.ResolveName().

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #648
Approved by: rhatdan
2018-05-02 19:52:53 +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
umohnani8 4743c2e7f1 Update buildah push doc
The example for the oci transport was misleading as it showed a different format.
Added an example for oci-archive. Added oci-archive to the Destinations.

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

Closes: #559
Approved by: rhatdan
2018-04-06 18:49:30 +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 811cf927d7 Change default certs directory to /etc/containers/certs.dir
Made changes to the man pages to reflect this.

Signed-off-by: umohnani8 <umohnani@redhat.com>
2018-02-06 17:04:34 -05:00
TomSweeneyRedHat 6c05a352df Add authfile param to commit
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #433
Approved by: rhatdan
2018-02-01 05:48:09 +00:00
TomSweeneyRedHat 7dc787a9c7 Prompt for un/pwd if not supplied with --creds
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2018-01-25 15:03:59 -05:00
Urvashi Mohnani 819c227bf2 Mention docker login in documentation for authentication
Since we fall back to reading the credentials from $HOME/.docker/config
set by docker login when kpod login doesn't have the credentials

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

Closes: #331
Approved by: rhatdan
2017-11-21 18:06:44 +00:00
Urvashi Mohnani 7a3bc6efd4 Use credentials from kpod login for buildah
buildah push and from now use the credentials stored in ${XDG_RUNTIME_DIR}/containers/auth.json by kpod login
if the auth file path is changed, buildah push and from can get the credentials from the custom auth file
using the --authfile flag
e.g buildah push --authfile /tmp/auths/myauths.json alpine docker://username/image

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

Closes: #325
Approved by: rhatdan
2017-11-16 18:08:52 +00:00
Urvashi Mohnani 4419612150 Add manifest type conversion to buildah push
buildah push supports manifest type conversion when pushing using the 'dir' transport
Manifest types include oci, v2s1, and v2s2
e.g buildah push --format v2s2 alpine dir:my-directory

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

Closes: #321
Approved by: rhatdan
2017-11-15 13:38:28 +00:00
Daniel J Walsh 4b38cff005 Cleanup buildah-push 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 c9c735e20d Add authentication to commit and push
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #250
Approved by: rhatdan
2017-08-29 15:20:19 +00:00
Daniel J Walsh 5259a84b7a atomic transport is being deprecated, so we should not document it.
containers/image now fully supports pushing images and signatures to an
openshift/atomic registry using the docker:// transport.

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

Closes: #238
Approved by: rhatdan
2017-08-02 12:01:26 +00:00
Daniel J Walsh 98ca81073e Improve buildah push man page and help information
This better documents the options available to the user.

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

Closes: #186
Approved by: rhatdan
2017-07-13 19:58:04 +00:00
Nalin Dahyabhai 3163a98bdd Add a "push" command
Add a "push" command, which pulls an image's layers from local storage,
recomputes the image's digest and manifest, and uses the image library
to write the result to the specified location.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #141
Approved by: rhatdan
2017-06-13 21:50:42 +00:00