From dafd71e01422b0f9bf2ade6c47f111377f84ec9f Mon Sep 17 00:00:00 2001 From: Kat Morgan Date: Tue, 14 Nov 2023 11:40:25 -0800 Subject: [PATCH] fix and activate nix + devbox in both architecture buildx builds (#18) * rm deprecated extension * add symbolic link for codespaces * fix qemu gha build failure * fix qemu gha build failure * fix qemu gha build failure * fix qemu gha build failure --- Dockerfile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 14a4f59..94cc412 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,8 @@ ENV TZ=UTC ENV DEBIAN_FRONTEND=noninteractive # Add go and nix to path ENV PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/nix/var/nix/profiles/default/bin" +# Set necessary nix environment variable +ENV NIX_INSTALLER_EXTRA_CONF='filter-syscalls = false' # Default to MS FROM image builtin user USER vscode @@ -101,11 +103,11 @@ RUN set -ex \ RUN set -ex \ && export urlNix="https://install.determinate.systems/nix" \ && export arch=$(uname -m | awk '{ if ($1 == "x86_64") print "amd64"; else if ($1 == "aarch64" || $1 == "arm64") print "arm64"; else print "unknown" }') \ - && [ ${arch} = "arm64" ] || curl --proto '=https' --tlsv1.2 -sSf -L ${urlNix} --output /tmp/install.sh \ - && [ ${arch} = "arm64" ] || chmod +x /tmp/install.sh \ - && [ ${arch} = "arm64" ] || /tmp/install.sh install linux --extra-conf "sandbox = false" --init none --no-confirm \ - && [ ${arch} = "arm64" ] || sh -c "nix --version" \ - && [ ${arch} = "arm64" ] || rm -rf /tmp/* \ + && curl --proto '=https' --tlsv1.2 -sSf -L ${urlNix} --output /tmp/install.sh \ + && chmod +x /tmp/install.sh \ + && /tmp/install.sh install linux --init none --extra-conf "filter-syscalls = false" --no-confirm \ + && sh -c "nix --version" \ + && rm -rf /tmp/* \ && true # Install devbox @@ -114,11 +116,11 @@ RUN set -ex \ RUN set -ex \ && export urlDevbox="https://get.jetpack.io/devbox" \ && export arch=$(uname -m | awk '{ if ($1 == "x86_64") print "amd64"; else if ($1 == "aarch64" || $1 == "arm64") print "arm64"; else print "unknown" }') \ - && [ ${arch} = "arm64" ] || curl --proto '=https' --tlsv1.2 -sSf -L ${urlDevbox} --output /tmp/install.sh \ - && [ ${arch} = "arm64" ] || chmod +x /tmp/install.sh \ - && [ ${arch} = "arm64" ] || /tmp/install.sh -f \ - && [ ${arch} = "arm64" ] || devbox version \ - && [ ${arch} = "arm64" ] || rm -rf /tmp/* \ + && curl --proto '=https' --tlsv1.2 -sSf -L ${urlDevbox} --output /tmp/install.sh \ + && chmod +x /tmp/install.sh \ + && /tmp/install.sh -f \ + && devbox version \ + && rm -rf /tmp/* \ && true # Install golang