Commit Graph

44 Commits

Author SHA1 Message Date
tomsweeneyredhat 7fede6a2ff [release-1.24] Bump Buildah to v1.24.7
As the title says

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-04-02 18:10:11 -04:00
Aditya R 00a369d099
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-09-23 13:03:35 +05:30
Nalin Dahyabhai c933610bfb tag v1.24.6
[NO NEW TESTS NEEDED]

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-09-20 13:04:32 -04:00
Nalin Dahyabhai 1100403aad Bump to v1.24.5
- Update the version number to v1.24.5 for tagging a new release.
- Drop commas from changelog dates because `rpmspec -q` doesn't like them.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-07-14 15:36:44 -04:00
Lokesh Mandvekar 12939a33d1
[CI:DOCS] Bump to v1.24.4
[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2022-05-11 10:22:50 -04:00
tomsweeneyredhat 8c85afc925 [release-1.24]Bump to v1.24.3
Bump to v1.24.3 inside of the release-1.24 branch.

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-03-31 09:38:40 -04:00
tomsweeneyredhat ce608bcecd Bump to v1.24.2
[NO TESTS NEEDED]

As the title says.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-02-16 12:12:21 -05: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
Paul Holzinger f9cff07b81
use libnetwork from c/common for networking
Podman uses the new netavark network stack. Buildah should be able to do
the same. Both projects should use the same networking code which was
move to c/common/libnetwork. The new network interface can use either
CNI or netvavark. Using the same code for podman and buildah is
important to ensure that both use the same backend. Mixing CNI and
netavark is not supported.

This also fixes some outstanding CNI issues, e.g. buildah trying to
connect all cni networks.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-07 18:10:26 +01:00
Daniel J Walsh a73e108bd0
Allow callers to replace the ContainerSuffix
This idea of this PR is to allow Podman to add a Podman
prefix to containers. This would allow it to keep track
of containers created by Podman and make it easier to remove
them when it wants to remove all.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-19 06:15:35 -05:00
Nalin Dahyabhai d08df52c14 Expand the godoc for CommonBuildOptions.Secrets
Some of our godoc strings manage to provide no information.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-11-11 14:20:13 -05:00
Daniel J Walsh a5d9f1cb28
Add --unsetenv option to buildah commit and build
This option will allow users to remove environment variables from the
final image.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-09 16:17:21 -05: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 a8b15f8d45
Report ignorefile location when no content added
Users have accidently had a .containerignore or .dockerignore
file in their context directly which blocked all content.
Currently we report that no globs matched, but do not
identify where the globs came from.

This change is an attempt to add this data to the error.
Example: https://github.com/containers/buildah/issues/3318

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-10-15 05:14:07 -04:00
Nalin Dahyabhai 100d5b12eb buildah build: add --all-platforms
Add a --all-platforms that instructs the builder to build for the
intersection of all platforms for which the build's base images are
available.  Returns an error if any of them aren't references to
manifest lists.  We've learned that we can't really trust architecture
and OS information stored in image config blobs, so we don't try to
salvage that case.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-09-29 15:43:46 -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
Kirill Shirinkin 2d822034f8 Rename bud to build, while keeping an alias for to bud.
Signed-off-by: Kirill Shirinkin <kirill@hey.com>
2021-08-25 17:56:58 +02:00
Nalin Dahyabhai 34d6ee13b8 imagebuildah: move multiple-platform building internal
Move multiple-platform build juggling logic from the CLI wrapper
directly into the imagebuildah package, to make using it easier for
packages that consume us as a library.

This requires reading Dockerfiles into byte slices so that we can
re-parse them for each per-platform build, rather than parsing them
directly, as we used to, since building modifies the parsed tree.

When building for multiple platforms, prefix progress log messages with
the platform description.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-08-11 15:24:56 -04:00
openshift-ci[bot] 88f55c8f15
Merge pull request #3409 from ashley-cui/sshagent
Implement SSH RUN mount
2021-08-06 22:35:40 +00:00
Ashley Cui 3a5635f90b Implement SSH RUN mount
Allow ssh socket from host or certain ssh keys to be exposed to a
certain RUN instruction, but not any other instructions, as well as not
showing up in the final image.
This is done by spawining a new agent from buildah and mounting
the listening socket inside the run. SSH_AUTH_SOCK inside the container
will be set to the socket mountpoint. The defualt mountpoint is
/run/buildkit/ssh_agent.{i}

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-08-06 09:00:06 -04:00
Nalin Dahyabhai ae08e01e49 bud: teach --platform to take a list
Add a pkg/parse.PlatformsFromOptions() which understands a "variant"
value as an optional third value in an OS/ARCH[/VARIANT] argument value,
which accepts a comma-separated list of them, and which returns a list
of platforms.

Teach "from" and "pull" about the --platform option and add integration
tests for them, warning if --platform was given multiple values.

Add a define.BuildOptions.JobSemaphore which an imagebuildah executor
will use in preference to one that it might allocate for itself.

In main(), allocate a JobSemaphore if the number of jobs is not 0 (which
we treat as "unlimited", and continue to allow executors to do).

In addManifest(), take a lock on the manifest list's image ID so that we
don't overwrite changes that another thread might be making while we're
attempting to make changes to it.  In main(), create an empty list if
the list doesn't already exist before we start down this path, so that
we don't get two threads trying to create that manifest list at the same
time later on.  Two processes could still try to create the same list
twice, but it's an incremental improvement.

Finally, if we've been given multiple platforms to build for, run their
builds concurrently and gather up their results.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-08-04 15:23:10 -04: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
Dan Čermák a6b3b6f672
Add rusage-logfile flag to optionally send rusage to a file
Currently the rusage is reported to stdout and rather cumbersome to parse. The
new flag rusage-logfile can be used to specify a file to which the log will be
written instead.

Signed-off-by: Dan Čermák <dcermak@suse.com>
2021-06-02 08:07:37 +02: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
Ashley Cui c8002d9739 Add support for secret mounts
Add support for secrets. Secrets is a two-part flag that allows secret files to
be accessed for a certain RUN instruction, but not any other
instructions, as well as now showing up in the final image.

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-04-23 09:19:43 -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 b5eac0b88d
Isolation strings, should match user input
When we parse isolation we expect users to input chroot, oci, rootless.

So when we translate the constants back to strings, we should use the
same values.

These human names need to be passed over the podman-remote build
bindings, so we need to make them match.

Also docker describes an isolation of "default", which we should also
handle for potential scripts.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-23 13:26:51 -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