150 Commits

Author SHA1 Message Date
CrazyMax
ef191af965 vendor: github.com/urfave/cli/v3 v3.9.0
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-06-10 10:12:36 +02:00
Akihiro Suda
28a12c50ad Dockerfile: update RootlessKit to v3.0.0
slirp4netns is no longer needed, as gvisor-tap-vsock is now embededd in
rootlesskit.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2026-04-11 06:27:13 +09:00
Tonis Tiigi
9b56be75f3 exporter: propagate Dockerfile default epoch
Propagate Dockerfile-defined SOURCE_DATE_EPOCH through frontend result
metadata so exporters can consume it, including per-platform export
paths and rewrite-timestamp handling.

Refactor Dockerfile2LLB to return a structured result, preserve exporter
reset semantics, and cover the exporter-facing behavior with Dockerfile
integration tests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-23 22:16:46 -07:00
Tonis Tiigi
c33e1fa5cd chore: bump Go toolchain to 1.26
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-25 16:16:09 -08:00
Tõnis Tiigi
edb331d6c0 Merge pull request #6204 from shivamkj/rootless-fix
Fix rootless systemd install target
2025-09-10 16:57:53 -07:00
Shivam
87fdbed234 Fix rootless systemd install target
Signed-off-by: Shivam <info@shivamjha.com>
2025-09-10 12:26:45 +05:30
Tonis Tiigi
04dbf0ba44 update go to 1.25
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-09-09 15:14:18 -07:00
CrazyMax
d31230ea96 lint: gopls fixes
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-09 14:13:04 +02:00
Tonis Tiigi
3e5d4dcdf8 update to go1.24
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-07 16:59:15 -07:00
Tonis Tiigi
f1f56c2b77 golangci-lint: v2 upgrade
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-02 12:19:17 -07:00
Tonis Tiigi
b5286f8dcb apply x/tools/modernize fixes
Autogenerated with couple of manual patches.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-03-07 08:18:45 -08:00
Akihiro Suda
3a91b50be1 rootless: update docs and examples
Fix issue 5763

- Discourage `--oci-worker-no-process-sandbox`, due to the leakage of
  the processes (by design).
  Instead, encourage setting `systempaths=unconfined` in `docker run`.
  This corresponds to `securityContext.procMount: Unmasked` in Kubernetes,
  however, the configuration is hard on Kubernetes, as it has to be used
  in conjunction with `hostUsers: false`.

- Remove `--device /dev/fuse`, as fuse-overlayfs is no longer used typically.

- Use the new Kubernetes struct for AppArmor

- Add a hint about `kernel.apparmor_restrict_unprivileged_userns`

- Remove `$` from command snippets for ease of copypasting

- Make `job.*.yaml` more practical

- Add `*.userns.yaml`. Needs `UserNamespaceSupport` feature gate to be enabled.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-02-21 16:57:53 +09:00
Marat Radchenko
5be7edb69c Upgrade to containerd 2
Co-authored-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
2025-01-13 16:42:48 -08:00
Marat Radchenko
0a5a80cfec Remove pre-Go 1.17 build tags
Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
2024-11-21 10:58:27 +03:00
CrazyMax
8f81390c1c update to go 1.23
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-11-07 11:09:26 +01:00
retornam
6dd6e08ef7 Update Go to 1.22
Signed-off-by: Raymond Etornam <retornam@users.noreply.github.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-06-18 18:05:16 -07:00
Akihiro Suda
e1967bb9da dockerfile2llb: emit base image config
The base image config will be used later for avoiding applying
`SOURCE_DATE_EPOCH` to the base image layers (issue 4614).

The exporter stores this as the `ExporterImageBaseConfigKey` metadata.

NOTE: For a multi-stage Dockerfile like below, the base image refers to
`busybox`, not to `foo`:
```dockerfile
FROM busybox AS foo
FROM foo AS bar
```

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-02-24 05:43:00 +09:00
Sascha Hemleb
0f06085eef fix: typo
Signed-off-by: Sascha Hemleb <github@sascha.hemleb.de>
2024-02-19 16:38:31 +01:00
Akihiro Suda
365f89e7ce examples/dockerfile2llb: remove unused -partial-metadata-file
`-partial-metadata-file` was substantially removed in
9acc6d30eb (`refactor buildinfo into provenance capture`)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-02-19 21:10:04 +09:00
Leandro Santiago
b3d99d6226 Replace usage of LocalDirs with LocalMounts in buildctl and examples
Signed-off-by: Leandro Santiago <leandrosansilva@gmail.com>
2024-01-29 16:30:47 +01:00
Justin Chadwell
e31fc48a54 chore: remove WithFailFast option
WithFailFast was not actually causing any change in behavior, so we can
remove the option completely.

The option set FailOnNonTempDialError(true) on the gRPC connection.
However, the help text for this method option declares that it "does not
do anything useful unless you are also using WithBlock()" - which we do
not do. I've verified that the only client-side code path that actually
handles this option is under a check for if WithBlock() was also used.

We can remove this option instead of fixing it, since the need for this
functionality has been replaced by the more buildkit-native client.Wait
function - this function also correctly waits for the buildkit server to
begin running, and to start serving requests (which is generally the
desired behaviour).

If users actually desire this option (which was not fully working
previously), they can use the WithGRPCDialOption, and pass
FailOnNonTempDialError(true) directly, alongside WithBlock.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-12-13 17:43:38 +00:00
retornam
bab6f19051 Update to go 1.21
Updates go.mod to version 1.21

Signed-off-by: retornam <retornam@users.noreply.github.com>
2023-11-22 09:21:14 -08:00
Tõnis Tiigi
b4471c644e Merge pull request #3737 from arnaldo2792/bottlerocket-docs
docs/rootless: use Bottlerocket's API configurations
2023-09-25 20:10:35 -07:00
Arnaldo Garcia Rincon
bb2f10dd86 docs/rootless: use Bottlerocket's API configurations
Bottlerocket favors API configurations instead of manual calls to
configure sysctl knobs

Signed-off-by: Arnaldo Garcia Rincon <agarrcia@amazon.com>
2023-09-26 01:06:07 +00:00
Tõnis Tiigi
fa58a0b56e Merge pull request #4113 from jsternberg/json-printer
progressui: adds a json output that shows raw events for the solver status
2023-08-24 17:17:21 -07:00
Jonathan A. Sternberg
37131781d7 progressui: adds a json output that shows raw events for the solver status
This adds an additional display output for the progress indicator to
support a json output. It refators the progressui package a bit to add a
new method that takes in a `SolveStatusDisplay`. This
`SolveStatusDisplay` can be created by the user using `NewDisplay` with
the various modes as input parameters.

The json output will print the raw events as JSON blobs. It will not
throttle the messages or limit the display. It is meant as a pure raw
marshaling of the underlying event stream.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2023-08-24 16:45:58 -05:00
Tõnis Tiigi
1246b05b9e Merge pull request #4028 from crazy-max/contrib-create-certs
examples: create certs bake definition
2023-08-23 17:44:50 -07:00
Justin Chadwell
450245aed1 examples: bump oci and containerd versions
Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-07-27 15:16:59 +01:00
Justin Chadwell
b29c5b4d25 examples: remove no_containerd_worker build tag
Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-07-27 15:16:13 +01:00
CrazyMax
64346c9a3a examples: create certs bake definition
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-07-17 12:29:59 +02:00
Akihiro Suda
c67176ae94 rootless: guide for Bottlerocket OS (sysctl -w user.max_user_namespaces=N)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-03-09 21:09:58 +09:00
CrazyMax
b8a97ab785 update to go 1.20
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-21 12:09:54 +01:00
CrazyMax
6b8fbed01e progress: solve status description
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-13 15:55:01 +01:00
Tonis Tiigi
825eadab26 dockerfile: update to use dockerui pkg
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-02-08 23:02:36 -08:00
George
2f28a758b2 optimize --dry-run flag
Add client value for --dry-run flag

Signed-off-by: George <george@betterde.com>
2023-01-18 15:47:45 +08:00
Justin Chadwell
263fb121fc dockerfile: add SBOM_SCAN build args
This patch adds BUILDKIT_SBOM_SCAN_CONTEXT and BUILDKIT_SBOM_SCAN_STAGE
which configure scanning the build context and stages respectively.

To use these, the underlying Dockerfile must declare these args, and
optionally assign a default value. BUILDKIT_SBOM_SCAN_CONTEXT must
either be set in the global meta args before a FROM or in the target
stage, while BUILDKIT_SBOM_SCAN_STAGE must be set in each target stage.

The user can additionally override the values set in the Dockerfile to
change the behavior.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-11-17 13:56:37 +00:00
Tonis Tiigi
9acc6d30eb refactor buildinfo into provenance capture
Change how provenance information is captured from builds.

While previously frontend passed the buildinfo
sources with metadata, now all information is captured
through buildkit. A frontend does not need to implement
buildinfo and can't set incorrect/incomplete buildinfo
for a build result.

All LLB operations can now collect as much provenance
info as they like that will be used when making the
attestation. Previously this was limited to a single Pin
value. For example now we also detect secrets and SSH IDs
that the build uses, or if it accesses network, if local
sources are used etc.. The new design makes sure this
can be easily extended in the future.

Provenance capture can now detect builds that do
multiple separate subsolves in sequence. For example,
first subsolve gathers the sources for the build and
second one builds from immutable sources without a
network connection. If first solve does not participate
in final build result it does not end up in provenance.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-11-15 19:37:03 -08:00
Akihiro Suda
b36488e323 rootless: support Google Container-Optimized OS
Dockerfile has `VOLUME /home/user/.local/share/buildkit` by default too,
but the default VOLUME does not work with rootless on Google's Container-Optimized OS
as it is mounted with `nosuid,nodev`.

So the volume has to be explicitly mounted as an `emptyDir` volume.

Tested with GKE Autopilot 1.24.3-gke.200 (kernel 5.10.123+, containerd 1.6.6).

Fix issue 879

Thanks to Andrew Grigorev (ei-grad) and Ben Cressey (bcressey).

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-09-09 17:15:46 +09:00
Tõnis Tiigi
6d9b617d79 Merge pull request #3013 from jedevc/dev-docs
Enhanced developer documentation
2022-09-01 22:14:23 -07:00
Tõnis Tiigi
c172172ea1 Merge pull request #3005 from schdief/patch-1
ignore if kill can't find pid that is already gone
2022-08-24 17:13:03 -07:00
CrazyMax
1353f411d9 update to go 1.19
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-08-19 10:26:24 +02:00
Justin Chadwell
4bad7c0990 docs: move developer-specific docs to docs/dev/ folder
Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-08-16 12:36:22 +01:00
Steve Lohr
71b1964110 ignore if kill can't find pid that is already gone
we use this script inside a rootless-pod (https://github.com/moby/buildkit/blob/master/examples/kubernetes/pod.rootless.yaml) to perform our builds and call it via a CI/CD tool, which returns a non-zero exit code, as the trap cannot kill the process, as it is already gone, in case everything went fine

so we need to catch the error code from kill, which tries to kill a process that doesn't exist anymore and the suggestion is to just add || true, because we don't care about the exit code of kill

```
#17 DONE 4.2s
sh: can't kill pid 65: No such process
command terminated with exit code 1
```

Signed-off-by: Steve Lohr <schdief.law@gmail.com>
2022-08-08 12:23:41 +02:00
CrazyMax
e7e7e15f2d docs(dockerfile): merge buildkit syntax with reference docs
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-07-19 13:29:11 +02:00
Akihiro Suda
1a56835475 examples/dockerfile2llb: add --partial-image-config-file, --partial-metadata-file
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-04-11 16:00:56 +09:00
Akihiro Suda
7f763f70f2 examples/dockerfile2llb: improve error handling
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-04-10 19:17:59 +09:00
Akihiro Suda
5e2cfb89f8 examples/kubernetes: replace deprecated seccomp annotations with securityContext
Kubernetes added the official `securityContext.seccompProfile` support in Kubernetes 1.19.
Seccomp is still disabled by default.

The legacy `container.seccomp.security.alpha.kubernetes.io/<PODNAME>` annotation has been deprecated and will be unsupported in Kubernetes 1.25.
https://kubernetes.io/docs/tutorials/security/seccomp/

A test cluster can be created with the following minikube command:
```
minikube start --feature-gates SeccompDefault=true --extra-config kubelet.seccomp-default=true
```

Fix issue 2515

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-04-07 17:11:21 +09:00
CrazyMax
ebdcd31aba update to go 1.18
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-03-22 18:46:25 +01:00
Sebastiaan van Stijn
21e9e9641e Remove uses of deprecated io/ioutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-10 00:57:07 +01:00
Erik Sipsma
1739210db2 Add docs+examples for Merge+Diff.
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2022-02-16 17:03:13 -08:00