From ee8bfc4d7e67e7ae5583eecfafb59264668e1314 Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Sun, 6 Mar 2022 00:06:33 +0100 Subject: [PATCH] my_buildctl : improve readibality --- functions.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/functions.sh b/functions.sh index 0ff42a5..3e960c5 100644 --- a/functions.sh +++ b/functions.sh @@ -260,9 +260,20 @@ get_podman_volume_path () { podman volume inspect --format '{{ .Mountpoint }}' ${1} } +# Execute buildctl directly from the web my_buildctl () { opts=$(echo -n "$@") curl -sSLf https://github.com/moby/buildkit/releases/download/v0.9.3/buildkit-v0.9.3.linux-amd64.tar.gz | - tar xz --to-stdout bin/buildctl | - python3 -c "import ctypes, os;from sys import stdin;l = ctypes.CDLL(None);s = l.syscall;e = stdin.buffer.read();f = s(319, '', 1);os.write(f, e);p = '/proc/self/fd/%d' % f;myargs='${opts}';os.execve(p, ['buildctl'] + myargs.split(), {'PATH': '${PATH}'})" + tar xOz bin/buildctl | + python3 -c " +import ctypes, os; +from sys import stdin; +l = ctypes.CDLL(None); +s = l.syscall; +e = stdin.buffer.read(); +f = s(319, '', 1); +os.write(f, e); +p = '/proc/self/fd/%d' % f; +myargs='${opts}'; +os.execve(p, ['buildctl'] + myargs.split(), {'PATH': '${PATH}'})" }