SHARE
TWEET

Untitled

a guest Jun 17th, 2019 118 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. { stdenv,
  2.   pkgs,
  3.   images,
  4.   registry,
  5.   tag
  6. }:
  7. let
  8.   myImages = stdenv.mkDerivation {
  9.     name = "images";
  10.     builder = builtins.toFile "builder.sh" ''
  11.       source $stdenv/setup
  12.  
  13.       echo "Copying images"
  14.       mkdir -p $out/var/lib/rancher/k3s/agent/images/
  15.       cp -r ${map (x:  "${x}") images} $out
  16.       echo "Uncompress them..."
  17.       ${pkgs.pigz}/bin/pigz -d $out/var/lib/rancher/k3s/agent/images/*
  18.       echo "Copy done!"
  19.     '';
  20.   };
  21. in
  22.   pkgs.dockerTools.buildImage {
  23.     name = "${registry}/myK3s";
  24.     inherit tag;
  25.     #created = "now";
  26.     fromImage = pkgs.dockerTools.pullImage {
  27.       imageName = "rancher/k3s";
  28.       imageDigest = "sha256:b770dbd95bd75d9b73404ac7753a85b6ac0db0d1df984d9cb41bd1bf228156e8";
  29.       sha256 = "4bc4889bbbe83dd035ad11379bb6948093f790a42d5b6882c62c4a3e406b5d43";
  30.       finalImageTag = "v0.5.0";
  31.     };
  32.  
  33.     contents = [ myImages ];
  34.  
  35.   config.Cmd = [ "/bin/k3s" ];
  36.   config.Env = [
  37.     "PATH=/bin:/bin/aux"
  38.   ];
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top