1
0
mirror of https://github.com/containers/buildah.git synced 2026-02-05 18:44:58 +01:00
Commit Graph

325 Commits

Author SHA1 Message Date
Toomas Vendelin
0dba767afe Added required devel packages
Signed-off-by: Toomas Vendelin <toomas.vendelin@gmail.com>
2021-01-21 19:23:02 +01: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
OpenShift Merge Robot
1b9ee76144 Merge pull request #2869 from rhatdan/bud
Add support for --manifest option in buildah bud and buildah commit
2021-01-08 08:37:12 -05:00
Daniel J Walsh
801da25a6e Buildah inspect should be able to inspect manifests
When you create a manifest or pull a manifest, it shows up
inside of the buildah images list.  When you go to inspect it
the inspect code blows up with a cryptic error message.

This patch fixes this problem and just uses the buildah manifest inspect
code.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-08 06:38:08 -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
Daniel J Walsh
7d9b57e9e1 Use --arch and --os and --variant options to select architecture and os
Remove --override-os and --override-arch flags.

Also use --platform option if specified when generating the SystemContext.
Conflict --platform option with --os, --arch and --variant options.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-06 06:43:13 -05:00
OpenShift Merge Robot
ffef8a6c0b Merge pull request #2864 from jsoref/spelling
Spelling
2020-12-23 17:04:31 +01:00
OpenShift Merge Robot
59cd527d6d Merge pull request #2847 from rhatdan/stdin
Allow users to specify stdin into containers
2020-12-22 09:08:59 -05:00
Daniel J Walsh
dc57eea023 Allow users to specify stdin into containers
Some commands within a Containerfile, might need input from users.
For example confirmation commands from Apt.

Adding a --stdin flag will allows users to interact with containers
while running inside of buildah bud.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-22 05:26:57 -05:00
OpenShift Merge Robot
5f1031f9d5 Merge pull request #2861 from rhatdan/run
Switch references of /var/run -> /run
2020-12-21 17:46:11 -05:00
Josh Soref
c7963db369 Spelling
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-12-21 16:47:18 -05:00
Daniel J Walsh
18f3e8724e Switch references of /var/run -> /run
Systemd is now complaining or mentioning /var/run as a legacy directory.
It has been many years where /var/run is a symlink to /run on all
most distributions, make the change to the default.

Partial fix for https://github.com/containers/podman/issues/8369

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-18 06:37:59 -05:00
TomSweeneyRedHat
7724292a4d Allow FROM to be overriden with from option
These changes will allow the "FROM" statement in a Containerfile
to be overridden with a new `--from` option.  If I have this Dockerfile.fedora

```
FROM fedora
```

This command will instead build an alpine image:

```
STEP 1: FROM alpine
Completed short name "alpine" with unqualified-search registries (origin: /etc/containers/registries.conf)
Getting image source signatures
Copying blob 188c0c94c7c5 done
Copying config d6e46aa247 done
Writing manifest to image destination
Storing signatures
STEP 2: COMMIT tom
--> d6e46aa2470
d6e46aa2470df1d32034c6707c8041158b652f38d2a9ae3d7ad7e7532d22ebe0
```

Addresses: #2404

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-12-17 19:30:53 -05:00
Eduardo Vega
1f4e751770 Add U volume flag to chown source volumes
Signed-off-by: Eduardo Vega <edvegavalerio@gmail.com>
2020-12-16 14:07:26 -06:00
Daniel J Walsh
fde2597af8 Add --ignorefile flag to use alternate .dockerignore flags
Allow users to override location of the .dockerignore file.
If user specified an --ignorefile flag, buildah will read the
file and pass in the exclude lines based on the .dockerignore
contents.

Also add a --contextdir flag to buildah copy and buildah add to
specify where the context directory is located.  For these two
commands the --ignorefile flag requires the --contextdir flag.

When the --ignorefile flag is passed in, the .dockerignore files
in the context directory will be ignored.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-24 15:28:07 -05:00
Daniel J Walsh
2d49f7c3bd Remove copy/paste errors that leaked Podman into man pages.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-20 11:51:14 -05:00
Daniel J Walsh
f280cd0285 Add --policy flag to buildah pull
This allows the user to specify the pull policy for pulling images.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-13 03:38:27 -05:00
Daniel J Walsh
619d9f9e16 Update buildah bud man page from podman build man page
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-07 06:12:10 -05:00
Daniel J Walsh
9e3e7ca8cc Switch default log level of Buildah to Warn. Users need to see these messages
Need to turn this on in Rawhide to see if we have any issues with it.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-27 15:46:09 -04: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
Daniel J Walsh
00b511e4d4 Move --userns-uid-map/--userns-gid-map description into buildah man page
Currently we are describing a root global option --userns-uid-map and --userns-gid-map
options in the buildah-bud man page, These global flags can be used in lots of buildah
commands, and should have complete description in the buildah man page.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-30 10:17:35 -04:00
Daniel J Walsh
123c8313d0 Merge pull request #2624 from rhatdan/mount
Fix buildah mount to display container names not ids
2020-09-17 09:06:54 -04:00
Daniel J Walsh
2aa4c79825 Merge pull request #2626 from rhatdan/man
Add missing --format option in buildah from man page
2020-09-16 08:02:05 -04:00
Daniel J Walsh
94a34115fe Fix buildah mount to display container names not ids
Currently we are displaying containerid rather then containername,
which is unknown to users.  Users refer to the container names all
of the time, so we should show the mounted containers based on names.

This change eliminates the need for the truncate flag on buildah mount
as well, so this PR hides it.

Fix up the man page documentation to use container names and show
proper output.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Co-authored-by: Sascha Grunert <sgrunert@suse.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-16 06:44:35 -04:00
Daniel J Walsh
c0b8ba5d25 Add missing --format option in buildah from man page
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-15 17:13:56 -04:00
Daniel J Walsh
2cf9c8f2b8 Fix up code based on codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-15 16:49:18 -04:00
Daniel J Walsh
1f8bf4dba2 Merge pull request #2583 from TomSweeneyRedHat/dev/tsweeney/tutclarify
Update Buildah Tutorial to address BZ1867426
2020-09-11 10:07:30 -04: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
TomSweeneyRedHat
3ef2c57f3c Update Buildah Tutorial to address BZ1867426
A bugzilla was created due to a misunderstaning gleened from the
Buildah tutorial.  The person runing the tutorial followed it exactly,
but the example blew up on RHEL for them.  The reason being is the
`--releasever` option has to use a valid version for the host's OS
when it's working on a scratch container or dnf will fail.

This adds clarifiction to the document to make that clear.

https://bugzilla.redhat.com/show_bug.cgi?id=1867426

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-09-09 19:07:15 -04:00
Flavio Castelli
6e1affc1cd Update manifest add man page
Ensure the freshly added flags are mentioned by the man page.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2020-09-07 15:28:25 +02:00
Daniel J Walsh
b715fb86ee Use --timestamp rather then --omit-timestamp
We recieved feedback on the --omit-timestamp that
users would rather specify the timestamp seconds
rather then just use EPOCH.

This PR removes --omit-timestamp from buildah bud
since this has never been released.

We also hide --omit-timestamp from buildah commit
and allow users to continue to use it, but it conflicts
with --timestamp.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-28 05:23:41 -04:00
André Werlang
8c3d8ea6ee docs: remove outdated notice
Signed-off-by: André Werlang <beppe85@gmail.com>
2020-08-25 14:41:22 -03:00
André Werlang
a5d61f6c65 docs: remove outdated notice
Signed-off-by: André Werlang <beppe85@gmail.com>
2020-08-25 14:41:17 -03:00
Nalin Dahyabhai
ac05e3aa2b docs/buildah-commit.md: tweak some wording, add a --rm example
Tweak wording to avoid suggesting that we add the actual text
"<none>:<none>" as a name for images when a name isn't specified to
`buildah commit`.

Add an example that uses `--rm` to the list of examples.

Co-authored-by: Tom Sweeney <tsweeney@redhat.com>
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-17 12:58:46 -04:00
Daniel J Walsh
d05957a6f6 Change namespace handling flags to better match podman commands
Podman namespaces flags handle the options slightly differently.

Specifically namespace flag `container` is very different.
Replace the `container` option with `private` to better match podman
but continue to support `container`

Similarly Podman expects --network ns:/PATH to allow the indication of a
path to a precreated network namespace.  Buildah just supported
--network /PATH, buildah will now support both formats, but document
ns:/path.

Finally use Aliases for fix some duplicated code in buildah.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-12 16:04:57 -04:00
Daniel J Walsh
29e957aef1 Merge pull request #2453 from jskovjyskebankdk/mergeTutorial
Howto for rootless image building from OpenShift
2020-08-11 17:51:10 -04:00
Jesper Skov
66986d187e Howto for rootless image building from OpenShift
Signed-off-by: Jesper Skov <jskov@jyskebank.dk>
2020-08-11 12:25:08 +02:00
Daniel J Walsh
8bb100be2a Add --omit-timestamp flag to buildah bud
Currently you can only do deterministic builds with commit command
this change will cause the metadata in the container image to be
epoch 0.

Next step is to save the data in the tar balls as 0.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-11 05:28:41 -04:00
Daniel J Walsh
d708fa8cf4 Enhance the .dockerignore man pages
Use different examples then the reference page.

Signed-off-by: Tom Sweeney <tsweeney@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-08 11:22:01 -04:00
Daniel J Walsh
69f735be1f Add documentation for .dockerignore
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-06 06:39:39 -04:00
xiadanni
5bc9748bd4 fix spelling mistake in "info" command result display
MenFree -> MemFree

Signed-off-by: xiadanni <xiadanni1@huawei.com>
2020-08-03 19:48:46 +08:00
Joel Lord
36a56cea58 Update 02-registries-repositories.md
I had a 'unknown flag --creds username:apikey' error message when trying as documented. Adding the '=' has fixed my issues (v.1.15)

Signed-off-by: Joel Lord <joelphy@gmail.com>
2020-07-22 07:16:09 -04:00
Ashley Cui
c7b46b7d85 Fix & add notes regarding problematic language in codebase
The Buildah project is committed to inclusivity, a core value of open source. Historically, there have been technology terms that are problematic and divisive, and should be changed. We are currently taking time to audit our repository in order to eliminate such terminology, and replace it with more inclusive terms. We are starting where we can, with our own code, comments, and documentation. However, such terms may be used in dependencies, and must be used as-is in our repositories at the current moment for compatibility. Buildah will change these terms in our repo as soon as new and better terminology is available to us via our dependencies.

For more information: https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language?sc_cid=701600000011gf0AAA

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-07-20 13:31:11 -04:00
Qi Wang
b507c62769 Set engine env from containers.conf
Set engine env from containers.conf. Mirror podman PR https://github.com/containers/podman/pull/6790.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-07-14 16:49:00 -04:00
Daniel J Walsh
a3f9c3c652 switch containers/libpod to containers/podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-13 17:21:55 -04:00
Giuseppe Scrivano
631ecf0562 buildah, bud: support --jobs=N for parallel execution
it enables running multi stages Containerfiles in parallel.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-07-01 09:34:02 +02:00
TomSweeneyRedHat
5e68ce9858 docs: clarify the 'triples' format
Replacing #2420 per it's author @markstos.  Adds clarification to what a
triple consists of for uid and and gids.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-06-22 16:06:43 -04:00
Brandon Lum
2054b5df8d Ammended docs
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2020-05-19 19:12:29 +00:00