Commit Graph

6 Commits

Author SHA1 Message Date
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
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
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
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
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