Commit Graph

119 Commits

Author SHA1 Message Date
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
CrazyMax
cdaafb9303 buildinfo: use metadata to set frontend build sources
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-02-14 21:55:20 +01:00
Tonis Tiigi
0dd260bcf5 progessui: return warnings from printer
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-11-30 21:58:37 -08:00
Anders F Björklund
4d6a45bfae Isolate systemd user network namespace from host
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-11-19 07:59:19 +01:00
Anders F Björklund
149400aa7e Add systemd support for rootless buildkitd
Also add systemd notify support, for both.

Use proxy and access all, for rootlesskit.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-11-18 20:34:55 +01:00
CrazyMax
54b8ff2fc8 go fmt: add //go:build
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-10-28 13:26:43 +02:00
Tonis Tiigi
ac61da5890 update go to 1.17
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-08-16 19:56:45 -07:00
Anders F Björklund
75d6fc2589 Set default socket permissions to 660
The systemd default is 666, it seems.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-07-30 13:41:14 +02:00
Tonis Tiigi
9f0236add1 daemonless: wait for daemon to finish before exit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-07-15 19:38:01 -07:00
Tonis Tiigi
e0124e192c llb: add constraints to async llb
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-22 21:34:43 -07:00
Sebastiaan van Stijn
22dd74ae93 update to go 1.16
This updates all occurrences of Go 1.13 to Go 1.16; also updated
the code that's used to redact credentials in URLs to use the Go
implementation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-02 00:31:57 +02:00
Anders F Björklund
0028c5ed7f Add support for fd:// for socket activation
Used go-systemd code from moby/moby daemon

Only added `buildkitd --addr fd://` for now.

Don't do systemd fds for windows buildkitd

Add buildkit systemd units README/examples

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2020-12-30 16:57:23 +01:00
CrazyMax
072078a403 Add lint
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2020-11-22 18:11:05 +01:00
Tonis Tiigi
ecf070a027 exec: use platform specific default path
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-23 15:30:23 -07:00
Akihiro Suda
d376a39357 buildctl-daemonless.sh: show log on "could not connect to ..."
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-07-24 16:14:59 +09:00
Anurag Goel
3cca542065 Fix shell args expansion in buildctl-daemonless.sh
When the special positional params character isn't enclosed in double
quotes it prevents users from passing in arguments spanning multiple
words. For example, `--opt build-arg:"word1 word2"` fails. Enclosing in
double quotes treats each parameter as a separate word.

More here:
https://tiswww.case.edu/php/chet/bash/bashref.html#index-_0024_0040

Signed-off-by: Anurag Goel <anurag@render.com>
2020-05-21 17:35:39 -07:00
Akihiro Suda
5fd091cedc create-certs.sh: fix a typo
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-05-17 10:23:09 +09:00
Jonathan Azoff
f592be2bbc Allow max retries on socket connect for buildctl
Signed-off-by: Jonathan Azoff <jon@azof.fr>
2020-05-15 00:25:02 -07:00
Tonis Tiigi
1a9d366b49 llb: asyncronous llb graph generation support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-03 14:55:10 -07:00
Tonis Tiigi
a60ecfa4ae vendor: restore dependency versions
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-02-24 17:31:01 -08:00
ChaosGramer
fe7a49fa09 add readiness and liveness probe as example
Signed-off-by: Jan Vaehsen (Windows) <janvaehsen@trieforce.de>
2019-11-22 18:20:28 +01:00
Akihiro Suda
14d5f06ed2 examples/kubernetes: use Parallel mode for StatefulSet
Parallel mode releaxes the pod creation order constraint.

https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#parallel-pod-management

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-11-12 19:24:52 +09:00
Akihiro Suda
1bde5d99d5 massive doc updates
* examples/kubernetes: newly added
* docs/rootless.md: cleaned up for better readability
* examples/README.md: split out from the main README.md
* examples/build-using-dockerfile/README.md: split out from the main README.md
* README.md: add TOC using https://github.com/thlorenz/doctoc
* README.md: add mTLS configuration (relates to #1074)
* README.md: add more adoptions
* README.md: add inline cache (fix #976)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-10-16 18:55:27 +09:00
Tonis Tiigi
ce9dfec05f hack: update containerd daemon
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-09-20 14:59:54 -07:00
Tonis Tiigi
b407790852 update containerd daemon to 1.2.7 and old to 1.1.7
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-08-20 17:02:43 -07:00
Ciro S. Costa
437a2d55c1 debug: add fileop to --dot
Previously, `fileop`s where not included in the set of possible op types
that were treated in the `dot` formatting in `buildctl debug dump-llb`
when using the `--dot` flag.

This commit add support for such fileop, allowing one to see basic
properties associated with the op.

Signed-off-by: Ciro S. Costa <cscosta@pivotal.io>
2019-08-04 16:50:42 -04:00
Tonis Tiigi
96b6a28312 exporter: allow oci exporters visibility to response metadata
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-07-31 10:21:19 -07:00
Akihiro Suda
bf220d3915 add buildctl-daemonless.sh
The script spawns ephemeral daemon for "daemonless" UX.

Usage:
  docker run -it --rm  \
  --security-opt seccomp=unconfined --security-opt apparmor=unconfined \
  -e BUILDKITD_FLAGS=--oci-worker-no-process-sandbox \
  -v /path/to/dir:/tmp/work \
  --entrypoint buildctl-daemonless.sh \
  moby/buildkit:master-rootless \
  build --frontend dockerfile.v0 --local context=/tmp/work --local dockerfile=/tmp/work

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-05-26 12:39:34 +09:00
Tonis Tiigi
dad1297d91 update runc to v1.0.0-rc8
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-05-15 14:22:42 -07:00
Akihiro Suda
aa9c666e16 add example/kube-consistent-hash
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-04-23 19:35:29 +09:00
Akihiro Suda
a67ba78d9e Merge pull request #809 from tonistiigi/fileop
llb: fileop implementation
2019-03-18 10:07:10 +09:00
Akihiro Suda
cd89a8ce3d go 1.12
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-03-17 04:38:23 +09:00