Skip to content
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

feat: add parameter extraBasePkgs #12120 #12121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jceb
Copy link

@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
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.

docker.nix Outdated
@@ -287,7 +288,7 @@ pkgs.dockerTools.buildLayeredImageWithNixDb {

inherit name tag maxLayers uid gid uname gname;

contents = [ baseSystem ];
contents = [ baseSystem ] ++ extraBasePkgs;;
Copy link
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
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
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
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
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
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
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.

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