From 842fe56de90e37a7d941101db05b27bee91a923a Mon Sep 17 00:00:00 2001 From: thespad Date: Sun, 28 Apr 2024 16:42:19 +0100 Subject: [PATCH 1/2] Create buildx container instance on init --- root/etc/s6-overlay/s6-rc.d/init-build-agent-config/run | 2 +- .../init-buildx-config/dependencies.d/svc-docker-in-docker | 0 root/etc/s6-overlay/s6-rc.d/init-buildx-config/run | 4 ++++ root/etc/s6-overlay/s6-rc.d/init-buildx-config/type | 1 + root/etc/s6-overlay/s6-rc.d/init-buildx-config/up | 1 + .../etc/s6-overlay/s6-rc.d/user/contents.d/init-buildx-config | 0 6 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 root/etc/s6-overlay/s6-rc.d/init-buildx-config/dependencies.d/svc-docker-in-docker create mode 100755 root/etc/s6-overlay/s6-rc.d/init-buildx-config/run create mode 100644 root/etc/s6-overlay/s6-rc.d/init-buildx-config/type create mode 100644 root/etc/s6-overlay/s6-rc.d/init-buildx-config/up create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/init-buildx-config diff --git a/root/etc/s6-overlay/s6-rc.d/init-build-agent-config/run b/root/etc/s6-overlay/s6-rc.d/init-build-agent-config/run index ec6fe61..76c3367 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-build-agent-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-build-agent-config/run @@ -99,7 +99,7 @@ find /run /var/run -iname 'docker*.pid' -delete || : # create docker group and add abc to it groupadd -f docker -if ! id -nG "$(id -nu "${PUID:-911}")" | grep -q "docker"; then +if ! id -nG "$(id -nu "${PUID:-911}")" | grep -q "docker"; then usermod -aG docker "$(id -nu "${PUID:-911}")" fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-buildx-config/dependencies.d/svc-docker-in-docker b/root/etc/s6-overlay/s6-rc.d/init-buildx-config/dependencies.d/svc-docker-in-docker new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/init-buildx-config/run b/root/etc/s6-overlay/s6-rc.d/init-buildx-config/run new file mode 100755 index 0000000..94800e8 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-buildx-config/run @@ -0,0 +1,4 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +docker buildx create --driver docker-container --name container diff --git a/root/etc/s6-overlay/s6-rc.d/init-buildx-config/type b/root/etc/s6-overlay/s6-rc.d/init-buildx-config/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-buildx-config/type @@ -0,0 +1 @@ +oneshot diff --git a/root/etc/s6-overlay/s6-rc.d/init-buildx-config/up b/root/etc/s6-overlay/s6-rc.d/init-buildx-config/up new file mode 100644 index 0000000..da44f31 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-buildx-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-buildx-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-buildx-config b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-buildx-config new file mode 100644 index 0000000..e69de29 From f70109512ded340ece8728debb37ad3a08567fb6 Mon Sep 17 00:00:00 2001 From: thespad Date: Sun, 28 Apr 2024 16:43:58 +0100 Subject: [PATCH 2/2] Redirect buildx create output --- root/etc/s6-overlay/s6-rc.d/init-buildx-config/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-buildx-config/run b/root/etc/s6-overlay/s6-rc.d/init-buildx-config/run index 94800e8..f78f5fa 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-buildx-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-buildx-config/run @@ -1,4 +1,4 @@ #!/usr/bin/with-contenv bash # shellcheck shell=bash -docker buildx create --driver docker-container --name container +docker buildx create --driver docker-container --name container >/dev/null 2>&1