Skip to content

Commit b05a69d

Browse files
committed
[docker image] set filter-syscalls = false in nix.conf to workaround missing seccomp BPF program in arm64 linux
1 parent 4427ad0 commit b05a69d

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

internal/devbox/generate/tmpl/DevboxImageDockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,27 @@ ARG DEVBOX_USE_VERSION
77
RUN apt-get update
88
RUN apt-get -y install bash binutils git xz-utils wget sudo
99

10-
# Step 1.5: Setting up devbox user
10+
# Step 2: Prepare for Nix
11+
ARG TARGETPLATFORM
12+
RUN mkdir -p /etc/nix/
13+
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ] || [ "$TARGETPLATFORM" = "linux/arm64/v8" ]; then \
14+
echo "filter-syscalls = false" >> /etc/nix/nix.conf; \
15+
fi
16+
17+
# Step 3: Setting up devbox user
1118
ENV DEVBOX_USER=devbox
1219
RUN adduser $DEVBOX_USER
1320
RUN usermod -aG sudo $DEVBOX_USER
1421
RUN echo "devbox ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$DEVBOX_USER
1522
USER $DEVBOX_USER
1623

17-
# Step 2: Installing Nix
24+
# Step 4: Installing Nix
1825
RUN wget --output-document=/dev/stdout https://nixos.org/nix/install | sh -s -- --no-daemon
1926
RUN . ~/.nix-profile/etc/profile.d/nix.sh
2027

2128
ENV PATH="/home/${DEVBOX_USER}/.nix-profile/bin:$PATH"
2229

23-
# Step 3: Installing devbox
30+
# Step 5: Installing devbox
2431
ENV DEVBOX_USE_VERSION=$DEVBOX_USE_VERSION
2532
RUN wget --quiet --output-document=/dev/stdout https://get.jetify.com/devbox | bash -s -- -f
2633
RUN chown -R "${DEVBOX_USER}:${DEVBOX_USER}" /usr/local/bin/devbox

internal/devbox/generate/tmpl/DevboxImageDockerfileRootUser

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ RUN apt-get update
88
RUN apt-get -y install bash binutils git xz-utils wget sudo
99

1010
# Step 2: Installing Nix
11+
ARG TARGETPLATFORM
1112
RUN mkdir -p /etc/nix/
12-
RUN echo "filter-syscalls = false" >> /etc/nix/nix.conf && wget --output-document=/dev/stdout https://nixos.org/nix/install | sh -s -- --daemon
13+
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ] || [ "$TARGETPLATFORM" = "linux/arm64/v8" ]; then \
14+
echo "filter-syscalls = false" >> /etc/nix/nix.conf; \
15+
fi
16+
RUN wget --output-document=/dev/stdout https://nixos.org/nix/install | sh -s -- --daemon
1317
RUN . ~/.nix-profile/etc/profile.d/nix.sh
1418

1519
ENV PATH="/root/.nix-profile/bin:$PATH"

0 commit comments

Comments
 (0)