Skip to content

Instantly share code, notes, and snippets.

@markus1189
Last active January 4, 2019 15:12
Show Gist options
  • Save markus1189/f006d58e494cce4c3ba570e64ec0baef to your computer and use it in GitHub Desktop.
Save markus1189/f006d58e494cce4c3ba570e64ec0baef to your computer and use it in GitHub Desktop.
DockerTools Problem
{ pkgs ? import <nixpkgs> {} }: with pkgs.dockerTools;
let
someBaseImage = pullImage {
imageName = "nixos/nix";
imageDigest = "sha256:1b97dc98b599779d80271d4203275627c0749d8bd5e9b9c868154249395cbc1b";
sha256 = "134h20xgpqchcvgv0f13knsi2p7jfl4m9mk8hkvdgh8hnz0hj3hc";
};
in
buildImage {
name = "test";
fromImage = someBaseImage;
contents = with pkgs; [ coreutils bash ];
config = {
Cmd = [ "bash" ];
};
runAsRoot = ''
#!${pkgs.stdenv.shell}
echo WORKS
'';
}
these derivations will be built:
/nix/store/ifr0wlrs7fwzckbxy13dwibd6g7wm0zg-docker-layer-test.drv
/nix/store/wqzf59iccc8hz7vp0jnb1amlmhxrxgmj-runtime-deps.drv
/nix/store/2msxbarm2yxcpmjjrv86k9519yp7vd5k-docker-image-test.tar.gz.drv
building '/nix/store/ifr0wlrs7fwzckbxy13dwibd6g7wm0zg-docker-layer-test.drv'...
Formatting '/nix/store/ba9n8flba7bdldirq15alsg9x2cgj0ka-docker-layer-test/disk-image.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off refcount_bits=16
cSeaBIOS (version rel-1.11.2-0-gf9626ccb91-prebuilt.qemu-project.org)
iPXE (http://ipxe.org) 00:03.0 C980 PCI2.10 PnP PMM+1FF91280+1FEF1280 C980
Booting from ROM...
loading kernel modules...isable)... ock
insmod: can't insert '/nix/store/pq0h15hsm6xlfnna3bs7g3cwmi05l05c-linux-4.14.88-shrunk/lib/modules/4.14.88/kernel/arch/x86/crypto/crc32c-intel.ko.xz': No such device
warning: unable to load /nix/store/pq0h15hsm6xlfnna3bs7g3cwmi05l05c-linux-4.14.88-shrunk/lib/modules/4.14.88/kernel/arch/x86/crypto/crc32c-intel.ko.xz
mounting Nix store...
mounting host's temporary directory...
starting stage 2 (/nix/store/61j10faypf9lvf9dkqxijlcllak5mlk6-vm-run-stage2)
mke2fs 1.44.4 (18-Aug-2018)
Creating filesystem with 262144 4k blocks and 65536 inodes
Filesystem UUID: 637d4455-ba31-4e5b-9467-b387b72b1aec
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Allocating group tables: 0/8 done
Writing inode tables: 0/8 done
Writing superblocks and filesystem accounting information: 0/8 done
Unpacking base image...
From-image name wasn't set. Read docker.io/nixos/nix.
From-image tag wasn't set. Read latest.
/nix/store/j6k3spjs9rfd334za09ndk6zpbmaailq-stdenv-linux/setup: line 1305: jq: command not found
[ 2.305906] reboot: Power down
builder for '/nix/store/ifr0wlrs7fwzckbxy13dwibd6g7wm0zg-docker-layer-test.drv' failed with exit code 127
cannot build derivation '/nix/store/2msxbarm2yxcpmjjrv86k9519yp7vd5k-docker-image-test.tar.gz.drv': 1 dependencies couldn't be built
error: build of '/nix/store/2msxbarm2yxcpmjjrv86k9519yp7vd5k-docker-image-test.tar.gz.drv' failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment