Sample Header Ad - 728x90

How to fix error building a Docker image with Nix using a pinned revision

1 vote
1 answer
433 views
I'm trying to build a Docker image with Nix at a pinned revision. The file works when it looks like this:
{ pkgs ? import  { }
}:

pkgs.dockerTools.buildImage {
  ...
But fails when it looks like this:
{ pkgs ? (import (builtins.fetchTarball { url = "https://github.com/NixOS/nixpkgs/archive/44fc3cb097324c9f9f93313dd3f103e78d722968.tar.gz "; sha256 = "0hxzigajiqjwxbk9bcbvgxq28drq1k2hgmzihs0c441i1wsbqchb";  }) {})
}:

pkgs.dockerTools.buildImage {
  ...
The error is:
error: 'buildImage' at /nix/store/pyq9xfm1ikhd70dfzbg6fywyqgcvly1l-source/pkgs/build-support/docker/default.nix:491:5 called with unexpected argument 'copyToRoot'
Any suggestions on what I'm doing wrong?
Asked by Matt R (395 rep)
Oct 21, 2022, 04:27 PM
Last activity: Oct 23, 2022, 08:57 AM