Skip to content

Commit

Permalink
fix: replace nix installer (#2163)
Browse files Browse the repository at this point in the history
## Description:
Fix the cross platform docker images that are trying to install nix by
replacing the installer and passing extra config params.

## Is this change user facing?
NO

## References (if applicable):
- DeterminateSystems/nix-installer#324
- NixOS/nix#5258
  • Loading branch information
lostbean committed Feb 15, 2024
1 parent ee4d4ca commit 8f68547
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions core/server/Dockerfile
Expand Up @@ -4,9 +4,10 @@ FROM alpine:3.17
RUN apk update && apk add --no-cache bash protobuf-dev sudo shadow curl xz

# Install Nix
# We need to set filter-syscalls to false to allow Nix to work properly inside a container: https://github.com/NixOS/nix/issues/5258
ENV NIX_INSTALL_ARGS="--extra-conf 'filter-syscalls = false'"
RUN sh <(curl -L https://nixos.org/nix/install) --daemon --yes
# We need to set filter-syscalls to false to allow Nix install to work properly inside a container with cross platform emulation
# via QEMU: https://github.com/NixOS/nix/issues/5258 and use a more flexible installer https://github.com/DeterminateSystems/nix-installer
# with a workaround on the same issue: https://github.com/DeterminateSystems/nix-installer/issues/324)
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux --no-confirm --init none --extra-conf "filter-syscalls = false"

ARG TARGETARCH

Expand Down
7 changes: 4 additions & 3 deletions core/server/Dockerfile.debug
Expand Up @@ -4,9 +4,10 @@ FROM alpine:3.19
RUN apk update && apk add --no-cache bash protobuf-dev sudo shadow curl xz

# Install Nix
# We need to set filter-syscalls to false to allow Nix to work properly inside a container: https://github.com/NixOS/nix/issues/5258
ENV NIX_INSTALL_ARGS="--extra-conf 'filter-syscalls = false'"
RUN sh <(curl -L https://nixos.org/nix/install) --daemon --yes
# We need to set filter-syscalls to false to allow Nix install to work properly inside a container with cross platform emulation
# via QEMU: https://github.com/NixOS/nix/issues/5258 and use a more flexible installer https://github.com/DeterminateSystems/nix-installer
# with a workaround on the same issue: https://github.com/DeterminateSystems/nix-installer/issues/324)
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux --no-confirm --init none --extra-conf "filter-syscalls = false"

# Make sure that you changed the port inside the APIC's code before changing it here
EXPOSE 50103
Expand Down

0 comments on commit 8f68547

Please sign in to comment.