Skip to content

Commit

Permalink
enforce building docker images on linux
Browse files Browse the repository at this point in the history
since it is not possible to do on macosx
  • Loading branch information
garbas committed Sep 24, 2020
1 parent 53cad40 commit 22a9cd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions demos/cover.scenario
Expand Up @@ -54,8 +54,8 @@ Start developing...

$ # For the last example, let us build a minimal docker image with Nix
$ cat -n docker-redis.nix
1 { pkgs ? import <nixpkgs> {} # nixpkgs package set
2 }:
1 { pkgs ? import <nixpkgs> { system = "x86_64-linux";}
2 }: # nixpkgs package set
3 pkgs.dockerTools.buildLayeredImage { # helper to build docker image
4 name = "nix-redis"; # give docker image a name
5 tag = "latest"; # provide a tag
Expand Down Expand Up @@ -98,8 +98,8 @@ $ # 2.) Build a statically linked binary with musl
$ # 3.) Remove all binaries apart from redis-server
$ # Now let's build the docker image with our newly created minimal redis
$ cat -n docker-redis-minimal.nix
1 { pkgs ? import <nixpkgs> {}
2 }:
1 { pkgs ? import <nixpkgs> { system = "x86_64-linux";}
2 }: # nixpkgs package set
3 let
4 redisMinimal = import ./redis-minimal.nix { inherit pkgs; };
5 in
Expand Down
4 changes: 2 additions & 2 deletions demos/example_4.scenario
Expand Up @@ -4,8 +4,8 @@ $ # We all love docker. But over time it can become tedious to write
$ # reliable docker files.
$ # What if you could use the power of Nix to build Docker images?
$ cat -n docker.nix
1 { pkgs ? import <nixpkgs> {} # nixpkgs package set
2 }:
1 { pkgs ? import <nixpkgs> { system = "x86_64-linux";}
2 }: # nixpkgs package set
3 pkgs.dockerTools.buildLayeredImage { # helper to build Docker image
4 name = "nix-hello"; # give docker image a name
5 tag = "latest"; # provide a tag
Expand Down

0 comments on commit 22a9cd6

Please sign in to comment.