all repos — website @ f94321a27b8ef36423445b021f53593cb46a9864

My website

Don't try to cross-build docker images with nix
Alan Pearce alan@alanpearce.eu
Sat, 01 Jul 2023 09:50:37 +0200
commit

f94321a27b8ef36423445b021f53593cb46a9864

parent

57e251e122e0f0d54c90103380aa83f80f0651fb

1 files changed, 3 insertions(+), 27 deletions(-)

jump to
M flake.nixflake.nix
@@ -40,33 +40,9 @@ postInstall = ''                 cp Caddyfile $out/
               '';
             };
-            docker = pkgs.dockerTools.buildImage {
-              name = "alanpearce/website";
-              fromImage = pkgs.dockerTools.pullImage {
-                imageName = "caddy";
-                finalImageName = "caddy";
-                finalImageTag = "2-alpine";
-                imageDigest = "sha256:d4ca216d8dc515a49bc20fa22a449283ade6c8fc132eb6fa412ff351664d4917";
-                sha256 = "auFzOG+6PSOVNXXXsRsEEThtIHJYM3JUkMQGcUt4cNQ=";
-              };
-              created = flockenzeit.lib.ISO-8601 self.lastModified;
-              copyToRoot = pkgs.buildEnv {
-                name = "website";
-                paths = with pkgs; [
-                  packages.default
-                  nss.tools
-                ];
-                pathsToLink = [ "/bin" "/public" ];
-              };
-              config = {
-                WorkingDir = "${packages.default}";
-                ExposedPorts = {
-                  "80/tcp" = { };
-                };
-                Volumes = {
-                  "/data" = { };
-                };
-              };
+            docker = import ./docker.nix {
+              inherit self pkgs flockenzeit;
+              website = packages.default;
             };
           };
           devShell = pkgs.mkShell {