Skip to content

Instantly share code, notes, and snippets.

@gilligan
Created January 26, 2018 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilligan/dcb188bc93d1131c610443d3947bffe5 to your computer and use it in GitHub Desktop.
Save gilligan/dcb188bc93d1131c610443d3947bffe5 to your computer and use it in GitHub Desktop.
# Build steps:
# $ nix-build docker.nix
# $ docker load -i result
# $ docker run hiplambda
with import <nixpkgs> { };
let
alpine = dockerTools.buildImage {
name = "alpine";
contents = cacert;
fromImage = dockerTools.buildImage {
name = "alpine";
fromImage = dockerTools.pullImage {
imageName = "alpine";
imageTag = "3.3";
imageId = "f58d61a874bedb7cdcb5a409ebb0c53b0656b880695c14e78a69902873358d5f";
sha256 = "0lvd5zxjgwp3jl5r8qgb2kapmxclpgdv1a7c03yiagxsil5gwb8c";
};
};
};
in
# TODO: Probably should make a Nix GHC base image.
dockerTools.buildImage {
name = "hiplambda";
fromImage = alpine;
contents = [ hello ];
config = {
ExposedPorts = {
"8080/tcp" = {};
};
};
}
$ nix-build
[...]
mounting Nix store...
mounting host's temporary directory...
starting stage 2 (/nix/store/7h6s5czqd5vyqhphhjcyrcnrcxb1iv7g-vm-run-stage2)
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
mke2fs 1.43.4 (31-Jan-2017)
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: 0800d9d2-fb88-4ab2-9322-44591b6497c1
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
.WARN[2018-01-26T22:19:42.061721217Z] [!] DON'T BIND ON ANY IP ADDRESS WITHOUT setting --tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING [!]
WARN[2018-01-26T22:19:42.063478687Z] could not change group /var/run/docker.sock to docker: error parsing groups for docker: open /etc/group: no such file or directory
INFO[2018-01-26T22:19:42.067721366Z] libcontainerd: new containerd process, pid: 386
WARN[0000] containerd: low RLIMIT_NOFILE changing to max current=1024 max=4096
WARN[2018-01-26T22:19:43.094571563Z] failed to rename /var/lib/docker/tmp for background deletion: rename /var/lib/docker/tmp /var/lib/docker/tmp-old: no such file or directory. Deleting synchronously
INFO[2018-01-26T22:19:43.205615149Z] Graph migration to content-addressability took 0.00 seconds
WARN[2018-01-26T22:19:43.206878770Z] Your kernel does not support cgroup cfs period
WARN[2018-01-26T22:19:43.207815804Z] Your kernel does not support cgroup cfs quotas
WARN[2018-01-26T22:19:43.208758358Z] Your kernel does not support cgroup rt period
WARN[2018-01-26T22:19:43.209680219Z] Your kernel does not support cgroup rt runtime
INFO[2018-01-26T22:19:43.210980529Z] Loading containers: start.
INFO[2018-01-26T22:19:43.609047487Z] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address
INFO[2018-01-26T22:19:43.808358160Z] Loading containers: done.
WARN[2018-01-26T22:19:43.811335936Z] Could not get operating system name: Error opening /usr/lib/os-release: open /usr/lib/os-release: no such file or directory
WARN[2018-01-26T22:19:43.879783650Z] failed to retrieve docker-runc version: unknown output format: runc version 1.0.0-rc4+dev
spec: 1.0.0
INFO[2018-01-26T22:19:43.891400954Z] Docker daemon commit=19e2cf6259bd7f027a3fff180876a22945ce4ba8 graphdriver(s)=overlay2 version=17.09.1-ce
INFO[2018-01-26T22:19:43.897705378Z] Daemon has completed initialization
INFO[2018-01-26T22:19:43.907949598Z] API listen on /var/run/docker.sock
INFO[2018-01-26T22:19:43.917977330Z] API listen on 127.0.0.1:5555
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
invalid repository name (f58d61a874bedb7cdcb5a409ebb0c53b0656b880695c14e78a69902873358d5f), cannot specify 64-byte hexadecimal strings
[ 4.548779] reboot: Power down
builder for ‘/nix/store/36c26z8anails8v3vk05fbyfvdbbjsa4-docker-image-alpine-3.3.tar.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/jp26c218k6vz2gr1ha26cyyh8iicik8x-docker-image-alpine.tar.gz.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/3q6wcvv0yp0yhk7wd6pf6jfgwakbbq57-docker-image-alpine.tar.gz.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/fha0h7v4njkp5nvxv1i97a50p5wamggq-docker-image-hiplambda.tar.gz.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/fha0h7v4njkp5nvxv1i97a50p5wamggq-docker-image-hiplambda.tar.gz.drv’ failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment