File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
internal/devbox/generate/tmpl Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -7,20 +7,27 @@ ARG DEVBOX_USE_VERSION
7
7
RUN apt-get update
8
8
RUN apt-get -y install bash binutils git xz-utils wget sudo
9
9
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
11
18
ENV DEVBOX_USER=devbox
12
19
RUN adduser $DEVBOX_USER
13
20
RUN usermod -aG sudo $DEVBOX_USER
14
21
RUN echo "devbox ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$DEVBOX_USER
15
22
USER $DEVBOX_USER
16
23
17
- # Step 2 : Installing Nix
24
+ # Step 4 : Installing Nix
18
25
RUN wget --output-document=/dev/stdout https://nixos.org/nix/install | sh -s -- --no-daemon
19
26
RUN . ~/.nix-profile/etc/profile.d/nix.sh
20
27
21
28
ENV PATH="/home/${DEVBOX_USER}/.nix-profile/bin:$PATH"
22
29
23
- # Step 3 : Installing devbox
30
+ # Step 5 : Installing devbox
24
31
ENV DEVBOX_USE_VERSION=$DEVBOX_USE_VERSION
25
32
RUN wget --quiet --output-document=/dev/stdout https://get.jetify.com/devbox | bash -s -- -f
26
33
RUN chown -R "${DEVBOX_USER}:${DEVBOX_USER}" /usr/local/bin/devbox
Original file line number Diff line number Diff line change @@ -8,8 +8,12 @@ RUN apt-get update
8
8
RUN apt-get -y install bash binutils git xz-utils wget sudo
9
9
10
10
# Step 2: Installing Nix
11
+ ARG TARGETPLATFORM
11
12
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
13
17
RUN . ~/.nix-profile/etc/profile.d/nix.sh
14
18
15
19
ENV PATH="/root/.nix-profile/bin:$PATH"
You can’t perform that action at this time.
0 commit comments