Commit Graph

18 Commits

Author SHA1 Message Date
Nalin Dahyabhai 5968d82047 build, commit: set the OCI ...created annotation on OCI images
When building or committing an image in OCI format, default to setting
the org.opencontainers.image.created annotation to the value used in the
image's config blob for the image's creation date. The behavior can be
controlled using the new --created-annotation flag.

Add --annotation and --unsetannotation flags to `buildah commit` which
mimic the same flags for `buildah build`.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-06-23 15:05:02 -04:00
Nalin Dahyabhai 962ab4bb1e commit,build: --source-date-epoch/--timestamp omit identity label
When using either --source-date-epoch or --timestamp, default to not
adding a label with our version number in it, since it can change
between builds.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-06-10 16:18:50 -04:00
Nalin Dahyabhai 865daceebb build: add --source-date-epoch and --rewrite-timestamp flags
Use $SOURCE_DATE_EPOCH as the default for the --source-date-epoch flag
to the "build" CLI.

When a source-date-epoch is set, we'll use it when writing new history
entries, force timestamps in data written for --output to the specified
timestamp, and populate a "SOURCE_DATE_EPOCH" ARG that we treat as
always being set, and which we don't complain about being left unused.
By default, this will not affect timestamps in newly-added layers.

Add a --rewrite-timestamp flag, which "clamps" timestamps in newly-added
layers to not be later than the --source-date-epoch value if the
--source-date-epoch flag is set, but has no effect otherwise.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-06-05 10:22:56 -04:00
Nalin Dahyabhai 6c82e7eac0 commit: add --source-date-epoch and --rewrite-timestamp flags
Add a --source-date-epoch flag, defaulting to $SOURCE_DATE_EPOCH if set,
which sets the created-on date and the timestamp for the new history
entries, but does not default to modifying the timestamps on contents in
new layers.

Add a --rewrite-timestamp flag, which "clamps" timestamps in the new
layers to not be later than the --source-date-epoch value if both
the --rewrite-timestamp and --source-date-epoch flags were set.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-06-04 13:02:26 -04:00
James Fraser a20d5b2a55
docs: correct default authfile path
Signed-off-by: James Fraser <wulfgar.pro@gmail.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-02-05 12:53:24 -05:00
Nalin Dahyabhai cf69e8a187 build,commit: add --sbom to scan and produce SBOMs when committing
Add a --sbom flag to `buildah build` and `buildah commit` which will
scan the rootfs and specified context directories to build SPDX or
CycloneDX SBOMs and lists of package URLs.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-01-19 13:55:57 -05:00
Nalin Dahyabhai de7c1e1f73 docs: fix a couple of typos
And don't refer to a filename in an example as a directory in
accompanying text.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-01-15 09:51:19 -05:00
Daniel J Walsh 59ea8af1b3
Document use of containers-transports values in buildah
Fixes: https://github.com/containers/buildah/issues/4740

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-12-20 06:26:15 -05:00
Nalin Dahyabhai 041388f87c commit: add a --add-file flag
Add a flag to `buildah commit` which allows adding arbitrary files to
the image while we're committing it.  When not squashing, they'll take
the form of a second new layer.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-12-13 17:17:43 -05:00
Ed Santiago 7dfdcf33b2 [CI:DOCS] man pages: underscores, too-wide lines
- remove unnecessary backslashes on underscores

 - trim leading spaces on some notes, making them <4.
   Too many leading spaces means to format as code.

Fixes: #4986

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-30 13:43:59 -07:00
Nalin Dahyabhai 3a61cc0996 Add OverrideChanges and OverrideConfig to CommitOptions
Add an OverrideChanges and an OverrideConfig field to CommitOptions,
both of which can be used to make last-minute edits to the configuration
of an image that we're committing.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-11-17 12:54:23 -05:00
Nalin Dahyabhai 4f3abf9367 Add some docs for `build --cw`, `commit --cw`, and `mkcw`
Add docs for the new --cw option recognized by both `commit` and
`build`, and the new `mkcw` command.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-09-07 14:05:10 -04:00
Aditya R c61ecc6964
build, commit: allow disabling image history with --omit-history
As per `OCI` `image-spec` setting history is optional so buildah must
support these use-cases via `--omit-history=true` some of the use-cases
are discussed below.

* There are use-cases when image-spec contributes to the image size by
  adding build history to image-spec in certain use-cases this image
history is not required by the end-users but there is no way to remove
it. See: https://github.com/containers/buildah/issues/3513

* Certain build tools don't honor setting build history in image spec
  however buildah does not allow processing images without build history
since setting build history is still optional as per `OCI` image-spec
( https://github.com/opencontainers/image-spec/blob/main/config.md#properties)
so buildah must support such use-cases.

Closes: https://github.com/containers/buildah/issues/4025
Closes: https://github.com/containers/buildah/issues/3513

Signed-off-by: Aditya R <arajan@redhat.com>
2022-06-03 00:40:48 +05:30
Aditya R e81dd7983c
build, commit: allow removing default identity labels
Allow end users to remove default identity labels if they want to.
Since there are instances where images can be reproduced across version
hence users must have option to suppress default labels.

Closes: https://github.com/containers/buildah/issues/3826

Signed-off-by: Aditya R <arajan@redhat.com>
2022-04-04 11:07:01 +05:30
Ed Santiago ae8995568b [CI:DOCS] man pages: sort flags, and keep them that way
Enforce alphabetical ordering of command-line options in
man pages. Not as simple as with podman, because conventions
are different.

Reference: https://github.com/containers/podman/pull/13625

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-03-24 08:27:06 -06:00
Erik Sjölund 76e9dbf8a6 [CI:DOCS] Fix typos and improve language
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-01-25 21:55:55 +01: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
Daniel J Walsh a9e66ec72b
Add man page for Containerfile and .containerignore
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-29 11:19:10 -04:00