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

oci-tools: Adds additional arguments and fixes a bug #93923

Closed

Conversation

@TethysSvensson
Copy link
Contributor

@TethysSvensson TethysSvensson commented Jul 26, 2020

Motivation for this change

This improves the pkgs.ociTools.buildContainer with some additional arguments. It also formats the file and fixes a bug where one of the arguments was unused.

Assuming the new arguments are left with default values, the derivation is almost identical to what it was before this commit. The only different is that the key process.env in config.json was not present before, while after this commit it will be an empty dictionary.

I am currently using this improved ociTools on my machine to build an ephemeral tor-browser inside a container, which is then started with runc.

The added arguments are:

  • uid => put into process.user.uid in config.json
  • gid => put into process.user.gid in config.json
  • processEnv => mapped to the right format and put into process.env in config.json.
  • namespaces => mapped to the right format and put into linux.namespaces in config.json.
  • shm-size => put into the mount options for the /dev/shm mount entry in config.json.
  • extraConfig => merged with the existing attributes in config.json.
  • extraSetupCommands => run as part of the command to build the derivation. Useful for e.g. creating extra directories in the resulting rootfs.
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@TethysSvensson TethysSvensson deleted the oci-tools-improvement branch Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant