Skip to content

feat: add parameter extraBasePkgs #12120#12121

Open
jceb wants to merge 1 commit into
NixOS:masterfrom
jceb:patch-1
Open

feat: add parameter extraBasePkgs #12120#12121
jceb wants to merge 1 commit into
NixOS:masterfrom
jceb:patch-1

Conversation

@jceb
Copy link
Copy Markdown

@jceb jceb commented Dec 31, 2024

Motivation

Adds support for additional base packages in the docker image.

Context

Solves #12120


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Copy link
Copy Markdown
Member

@roberth roberth left a comment

Choose a reason for hiding this comment

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

See comment, and needs tests and documentation.

Comment thread docker.nix Outdated
inherit name tag maxLayers uid gid uname gname;

contents = [ baseSystem ];
contents = [ baseSystem ] ++ extraBasePkgs;;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

iirc passing more than one element turns the whole root file system into a symlink farm.
I doubt that this is correct or intended.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Could you elaborate on what this will change will cause? In my understanding, this is the intended way of how nix docker image building works.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Only partly. We also need things in the root file system that aren't symlinks, such as /tmp and /var which are created as part of baseSystem.

Copy link
Copy Markdown
Author

@jceb jceb Dec 31, 2024

Choose a reason for hiding this comment

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

Yes, I understand. So how are additional packages interfering with this? Isn't this what's happening on NixOS every time I install a package?

I'm still trying to understand whether this PR makes sense or not. At the moment, I have trouble reconciling what you're saying with how I've been using nix dockerTools and my everyday NixOS.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

NixOS doesn't have a contents that fills the root file system. It sets up various parts of the root file system on installation, on boot, and on activation.
dockerTools is fairly low level and doesn't do many of the things NixOS does.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you for your feedback. Is there anything else that needs to be addressed to resolve this thread?

@edolstra
Copy link
Copy Markdown
Member

needs tests and documentation

I don't think we have any tests for docker.nix at the moment so this may be overkill. We have some docs in doc/manual/source/installation/installing-docker.md, but I don't want to create the impression that docker.nix is a stable interface that we have to maintain.

agucova added a commit to agucova/nix that referenced this pull request Dec 12, 2025
  Fix intermittent SIGSEGV (exit code 139) on macOS when running
  nix-shell and shebang tests inside the nix sandbox.

  The foo, bar, and ruby test scripts were created without shebangs,
  which causes intermittent crashes when executed via command
  substitution on macOS. Adding proper shebangs resolves the flakiness.

  Potentially closes: NixOS#12121
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants