Commit Graph

48 Commits

Author SHA1 Message Date
tomsweeneyredhat c939b9307c [release-1.29] Bump to Buildah v1.29.5
Bump to Buildah v1.29.5.  This will contain a fix for CVE-2024-11218 and
will be vendored into the Podman 4.4-rhel release branch to address the
issue there for RHEL 8.6, RHEL 9.0, and a variety of OCP versions.

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-02-06 15:29:02 -05:00
Nalin Dahyabhai 30ac3fabe8
define.TempDirForURL(): always use an intermediate subdirectory
Ensure that the temporary directory that we create is never itself the
top-level directory of the content that we're downloading, in case it's
an archive which includes a "." with weird permissions.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Signed-off-by: David Shea <dshea@redhat.com>
2025-02-06 09:52:25 -05:00
David Shea 0175881927 [release-1.29] Bump to v1.29.4
Signed-off-by: David Shea <dshea@redhat.com>
2024-10-17 14:53:22 -04:00
tomsweeneyredhat 79aede6205 [release-1.29] Bump to v1.29.3
As the title says.

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-03-26 16:37:56 -04:00
Nalin Dahyabhai b98e39b006 Bump version to v1.29.2
[NO NEW TESTS NEEDED]

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-10-31 09:30:28 -04:00
tomsweeneyredhat faf0d4fcba [release-1.29] Bump to Buildah v1.29.1
As the title says.  In preparation for RHEL 8.8/9.2

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-02-15 16:11:40 -05:00
tomsweeneyredhat 94b723cb5b Bump to v1.29.0
As the title says.

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-01-25 18:22:54 -05:00
Chris Evich 46eea31588
Replace io/ioutil calls with os calls
In golang 1.19, `io/ioutil` is fully deprecated preventing Buildah from
compiling.  Replace all calls with equivalent calls from the `os`
package.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-12-06 14:29:32 -05:00
Doug Rabson 5e792e97b0 version: Bump to 1.29.0-dev
[NO TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-11-30 11:25:31 +00:00
Daniel J Walsh eae3415b1e
Bump to v1.28.1-dev
[NO TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-30 21:38:43 -04:00
Daniel J Walsh 79f41e3235
Bump to v1.28.0
[NO TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-30 21:38:43 -04:00
Daniel J Walsh 8d5d763213
Fix stutters
Podman adds an Error: to every error message. So starting an error
message with "error" ends up being reported to the user as

Error: error ...

This patch removes the stutter.

Also ioutil.ReadFile errors report the Path, so wrapping the err message
with the path causes a stutter.

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

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-19 07:11:44 -04:00
Aditya R 3a6919b5c0 version: bump to 1.28.0-dev
[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
2022-08-08 17:09:19 +05:30
Aditya R db8d5921a7 release: tag v1.27.0
* build: support filtering cache by duration using `--cache-ttl`.
  * build: support building from commit when using git repo as build context.
  * build: clean up git repos correctly when using subdirs.
  * build: add support for distributing cache to remote sources using `--cache-to` and `--cache-from`.
  * imagebuildah: optimize cache hits for `COPY` and `ADD` instructions.
  * build: support OCI hooks for ephemeral build containers.
  * build: add support for `--userns=auto`.
  * copier: add NoOverwriteNonDirDir option .
  * add initial support for building images using Buildah on FreeBSD.
  * multistage: this now skips the computing of unwanted stages to improve performance.
  * multiarch: support splitting build logs for `--platform` using `--logsplit`.
  * build: add support for building images where the base image has no history.
  * commit: allow disabling image history with `--omit-history`.
  * build: add support for renaming a device in rootless setups.
  * build: now supports additionalBuildContext in builds via the `--build-context` option.
  * build: `--output` produces artifacts even if the build container is not committed.
  * build: now accepts `-cpp-flag`, allowing users to pass in CPP flags when processing a Containerfile with C Preprocessor-like syntax.
  * build: now accepts a branch and a subdirectory when the build context is a git repository.
  * build: output now shows a progress bar while pushing and pulling images
  * build: now errors out if the path to Containerfile is a directory.
  * build: support building container images on environments that are rootless and without any valid login sessions.
  * fix: `--output` now generates artifacts even if the entire build is cached.
  * fix: `--output` generates artifacts only for the target stage in multi-stage builds.
  * fix,add: now fails on a bad HTTP response instead of writing to container
  * fix,squash: never use build cache when computing the last step of the last stage
  * fix,build,run: allow reusing secret more than once in different RUN steps
  * fix: compatibility with Docker build by making its --label and --annotate options set empty labels and annotations when given a name but no `=` or label value.

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
2022-08-08 17:09:19 +05:30
Aditya R b218fdf322
build: support building from commit when using git repo as build context
When using URL to a git repo as build context allow specifying `commit`
to make sure specific `commit` is used as the build context.

Examples

```console
buildah build -t test myrepo.git#abcef123
buildah build -t test myrepo.git#abcef123
buildah build -t test myrepo.git#abcef123:somesubdir
```
Closes: https://github.com/containers/buildah/issues/4148

Signed-off-by: Aditya R <arajan@redhat.com>
2022-08-03 18:50:44 +05:30
Nalin Dahyabhai 99488b06f6 build: clean up git repos correctly when using subdirs
When the build context is specified as a subdirectory in a Git
repository, we were cloning the repository to start, but only removing
the subdirectory when we were finished with it.  We should be removing
the whole clone.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-08-02 17:33:29 -04:00
Sascha Grunert ce384684c0
Switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-07 11:41:47 +02:00
Aditya R 066b544853
define.downloadToDirectory: fail early if bad HTTP response
Fail early if downloadToDirectory receives bad HTTP response from the
source URL.

Signed-off-by: Aditya R <arajan@redhat.com>
2022-07-01 20:53:03 +05:30
Aditya R 20c5c5c6d8
build, userns: add support for --userns=auto
Buildah now supports `--userns=auto` which can automatically pick an empty range and create an user namespace for the container.

The `--userns=auto` flag, requires that the user name containers and a range of subordinate user ids that the build container is allowed to use be specified in the /etc/subuid and /etc/subgid files.

Example: `containers:2147483647:2147483648`.

Buildah allocates unique ranges of UIDs and GIDs from the containers subordinate user ids. The size of the ranges is based on the number of UIDs required in the image. The number of UIDs and GIDs can be overridden with the size option.

Valid auto options:

    * gidmapping=CONTAINER_GID:HOST_GID:SIZE: to force a GID mapping to be present in the user namespace.

    * size=SIZE: to specify an explicit size for the automatic user namespace. e.g. --userns=auto:size=8192. If size is not specified, auto will estimate a size for the user namespace.

    * uidmapping=CONTAINER_UID:HOST_UID:SIZE: to force a UID mapping to be present in the user namespace.

Signed-off-by: Aditya R <arajan@redhat.com>
2022-06-20 13:08:02 +05:30
Aditya R 784a8c4ce2
build: accept branch and subdirectory when context is git repo
When using `build -t <tag> <some-url-to-git-repo>` buildah does not
accepts syntax `url#branch:subdir` following commit allows end users to
switch context to any subdirectory in the git repo.

Usage
```console
buildah build -t test 'https://github.com/containers/podman.git#main:contrib/hello'
```

Signed-off-by: Aditya R <arajan@redhat.com>
2022-05-13 21:55:30 +05:30
tomsweeneyredhat 6750810f74 Bump to v1.27.0-dev
As the title says
[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-05-04 12:28:08 -04:00
tomsweeneyredhat 0a9d6e6eae Bump to v1.26.0
As the title says.

[NO TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-05-04 12:28:07 -04:00
Aditya R d0336f2147
buildkit: add support for custom build output with --output
Allows end-users to export final build content or rootfs to external formats.

By default, a local container image is created from the build result. The --output (or -o) flag allows you to override this behavior, and a specify a custom exporter. For example, custom exporters allow you to export the build artifacts as files on the local filesystem instead of a Container image, which can be useful for generating local binaries, code generation etc.

The value for --output is a CSV-formatted string defining the exporter type and options. Currently, local and tar exporters are supported. The local exporter writes the resulting build files to a directory on the client side. The tar exporter is similar but writes the files as a single tarball (.tar).

```console
buildah build --output type=local,dest=dir .
buildah build --output type=tar,dest=rootfs.tar .
buildah build -o dir .
```
Reference: https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs

Signed-off-by: Aditya R <arajan@redhat.com>
2022-04-29 21:44:38 +05:30
tomsweeneyredhat 822a288ba9 Bump to v1.26.0-dev
[NO NEW TESTS NEEDED]

As the title says.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-03-25 10:25:56 -04:00
tomsweeneyredhat cdcaaf51b3 Bump to v1.25.0
[NO NEW TESTS NEEDED]

As the title says.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-03-25 10:07:31 -04:00
tomsweeneyredhat 97ba8c1bb2 Bump to v1.25.0-dev
[NO TESTS NEEDED]

As the title says.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-01-26 16:52:23 -05:00
tomsweeneyredhat 29f6b4f706 Bump to v1.24.0
[NO TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-01-26 16:48:03 -05:00
Paul Holzinger d7ccff3edb
Fix default CNI paths
We need to use the default from containers.conf and not hardcode them in
buildah. This fixes an issue with the cni network backend since it would
try to access /etc/cni/net.d/ even as rootless user. This regression was
introduced in commit f9cff07b81.

Also hide the cni flags as we do not expect users to change this. The
recommended way is to change them in containers.conf.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-10 15:49:43 +01:00
Nalin Dahyabhai 85ed96bb92 define.TempDirForURL(): show CombinedOutput when a command fails
When define.TempDirForURL() runs an external command, if it fails,
include the command's output in the error that's handed back to its
caller so that the end-user has some idea of what happened.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-11-08 10:31:53 -05:00
Ashley Cui 326edb312e Add support for env var secret sources
Run secrets can now be created from an environment variable. The
environment variable is read and is briefly stored as a file on /dev/shm
when it's being used, and the file is removed after the RUN command is
finished.

Fixes: #3524

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-10-26 13:18:00 -04:00
Daniel J Walsh 5fbfcf9794
Bump to v1.24.0-dev
[NO TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-13 16:38:37 -04:00
Daniel J Walsh 37fe4e86c2
Bump to v1.23.0
[NO TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-13 16:38:37 -04:00
Leigh McCulloch 7b15d26248 Fix build with .git url with branch
The build with git URL recognizes git URLs by either a git:// scheme prefix, or
any other URL with other schemes such as https:// and a .git suffix.

The build with git URL and branch recognizes the branch name as the fragment
part of the URL, the part after the #.

The .git suffix check is performed by checking that the suffix of the full URL
is .git, however this causes URLs that begin with scheme https://, and have a
.git path suffix, to not be recognized as git URLs when a branch name is
appended.

The logic for checking if the URL path is suffixed with .git should parse the
URL first and consider only the path when looking for the suffix. This change
is implemented in this commit.

This commit also removes the guard within the cloneToDirectory function because
it is unnecessary since every location the function is called the check has
already been carried out.

Signed-off-by: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com>
2021-09-06 00:17:38 -07:00
TomSweeneyRedHat c4346ef47f Bump to v1.23.0-dev [NO TESTS NEEDED]
[NO TESTS NEEDED]
As the title says.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2021-08-02 14:18:04 -04:00
TomSweeneyRedHat e6ea308d6d Bump to v1.22.0 [NO TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2021-08-02 14:17:56 -04:00
Daniel J Walsh 1fff9bdbc4
Move to v1.22.0-dev
Since we have a release v1.21.0 going into long term branch, we need to
bump to the next version.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-06-02 15:27:05 -04:00
TomSweeneyRedHat 23924afa06 Bump to v1.21.1-dev [NO TESTS NEEDED]
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2021-05-19 17:58:27 -04:00
TomSweeneyRedHat 5e3515c5b0 Bump to v1.21.0 - [NO TESTS NEEDED]
[NO TESTS NEEDED] As the title says

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2021-05-19 17:47:55 -04:00
TomSweeneyRedHat e5c5760e87 Bump to v1.20.2-dev
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2021-04-13 18:08:07 -04:00
TomSweeneyRedHat 99f733350d Bump to v1.20.1
As the title says.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2021-04-13 18:05:44 -04:00
Daniel J Walsh f66a6d660d
[NO TESTS NEEDED] Use --recurse-modules when building git context
If a git repository contains submodules, we need to check them all
out because the Containerfile/Dockerfile at the repo might use them.

Fixes: https://github.com/containers/buildah/issues/3104

It is too complicated to setup a recursive submodules git repo, so
setting no tests needed.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-26 07:55:58 -04:00
Daniel J Walsh c13f7e3c79
Bump to v1.20.1-dev
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-25 13:34:38 -04:00
Daniel J Walsh 293e02ac06
Bump to v1.20.0
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-25 13:28:06 -04:00
Daniel J Walsh 898eea8fbe
Make PolicyMap and PullPolicy names align
Currently it is impossible to switch from a PullPolicy type
and PolicyMap via strings.  This PR Makes the types align.

This is required to make passing of PullPolicy in podman-remote
to work.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-05 06:21:59 -05:00
Daniel J Walsh 514a3f1a91
Shrink the vendoring size of pkc/cli
This PR removes the pkg/auth which brings in docker/docker
since it really is not needed, and was only there to help users
discover the settings of where the authfile was, when the environment
variables were set.  Would almost never be of any value.

Move imagebuildah.BuildOptions to define.BuildOptions

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-03 14:18:35 -05:00
Daniel J Walsh 4704e6cb3f
Eliminate the use of containers/building import in pkg subdirs
We want to shrink the size of the import when importing pkg from
buildah. This should help us shrink the size of the golang bindings
in podman.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-12 12:43:08 -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
baude 681e3eff98 refactor pullpolicy to avoid deps
refeactor the pullpollicy to its own package so that it can be imported on its own without deps like containers/storage, etc. this will help consuming podman's go bindings.

Signed-off-by: baude <bbaude@redhat.com>
2020-10-12 13:17:31 -05:00