Skip to content

[docker] fix for devbox docker image root-user build #1811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 15, 2024

Conversation

mohsenari
Copy link
Collaborator

Summary

This fix is due to customer message in discord mentioning the launcher having old version.
Nix installation in docker-image-build-publish workflow was failing for root-user mode.
This PR fixes it.
The fix was based on recommendation from LnL7/nix-docker#41 (comment)

How was it tested?

https://github.com/jetpack-io/devbox/actions/runs/7893709911

@mohsenari mohsenari requested a review from mikeland73 February 13, 2024 22:57
@@ -5,7 +5,8 @@ RUN apt-get update
RUN apt-get -y install bash binutils git xz-utils wget sudo

# Step 2: Installing Nix
RUN wget --output-document=/dev/stdout https://nixos.org/nix/install | sh -s -- --daemon
RUN mkdir -p /etc/nix/
RUN echo "filter-syscalls = false" >> /etc/nix/nix.conf && wget --output-document=/dev/stdout https://nixos.org/nix/install | sh -s -- --daemon
Copy link
Contributor

@mikeland73 mikeland73 Feb 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: split into 2 RUN commands for readability (or format so it's one command per line using \)

@mohsenari mohsenari merged commit caba63c into main Feb 15, 2024
@mohsenari mohsenari deleted the mohsen--devbox-image-test branch February 15, 2024 16:35
savil added a commit that referenced this pull request Aug 5, 2025
…missing `seccomp BPF program` in arm64 linux (#2665)

## Summary

The docker-image is failing to build in GHA:

https://github.com/jetify-com/devbox/actions/runs/16204700194/job/47358742840

The error indicates that the seccomp (secure computing mode) BPF
(Berkeley Packet Filter) program that Nix tries to load is incompatible
with the Docker container environment on ARM64.

When filter-syscalls = true (the default), Nix uses seccomp BPF to
filter system calls for security sandboxing. Setting filter-syscalls =
false disables Nix's syscall filtering, which bypasses the seccomp BPF
program entirely and prevents the error.

This PR uses the approach from #1811 to fix this for arm64 platforms.


## How was it tested?

`docker build --platform linux/arm64 -t devbox-image-arm64 -f
/Users/savil/code/jetpack/devbox/internal/devbox/generate/tmpl/DevboxImageDockerfile
.`
`docker build --platform linux/arm64 -t devbox-image-arm64 -f
/Users/savil/code/jetpack/devbox/internal/devbox/generate/tmpl/DevboxImageDockerfileRootUser
.`

BEFORE: these failed with the error seen in the GHA above
AFTER: build successfully

Also confirmed that --platform linux/amd64 would build successfully

## Community Contribution License

All community contributions in this pull request are licensed to the
project
maintainers under the terms of the
[Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0).

By creating this pull request, I represent that I have the right to
license the
contributions to the project maintainers under the Apache 2 License as
stated in
the
[Community Contribution
License](https://github.com/jetify-com/opensource/blob/main/CONTRIBUTING.md#community-contribution-license).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants