diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-06-09 00:27:06 -0700 |
---|---|---|
committer | Jade Lovelace <lix@jade.fyi> | 2024-06-09 20:33:24 -0700 |
commit | 9aeb314e6a8276d3bd29f968c2baa44d5d19ca37 (patch) | |
tree | 9177ce42c9e62776b0a71ae31830ccb1c79ff05c /docker.nix | |
parent | 4392d89eeaf4560bf41e0c914b8f42f2959964d3 (diff) |
releng: support multiarch docker images
If we don't want to have separate registry tags by architecture (EWWWW),
we need to be able to build multiarch docker images. This is pretty
simple, and just requires making a manifest pointing to each of the
component images.
I was *going* to just do this API prodding with manifest-tool, but it
doesn't support putting metadata on the outer manifest, which is
actually kind of a problem because it then doesn't render the metadata
on github. So I guess we get a simple little containers API
implementation that is 90% auth code.
Change-Id: I8bdd118d4cbc13b23224f2fb174b232432686bea
Diffstat (limited to 'docker.nix')
-rw-r--r-- | docker.nix | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/docker.nix b/docker.nix index a60fd5763..b23a9637f 100644 --- a/docker.nix +++ b/docker.nix @@ -1,5 +1,7 @@ { pkgs ? import <nixpkgs> { }, + # Git commit ID, if available + lixRevision ? null, nix2container, lib ? pkgs.lib, name ? "lix", @@ -353,6 +355,23 @@ let "NIX_SSL_CERT_FILE=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt" "NIX_PATH=/nix/var/nix/profiles/per-user/root/channels:/root/.nix-defexpr/channels" ]; + + Labels = { + "org.opencontainers.image.title" = "Lix"; + "org.opencontainers.image.source" = "https://git.lix.systems/lix-project/lix"; + "org.opencontainers.image.vendor" = "Lix project"; + "org.opencontainers.image.version" = pkgs.nix.version; + "org.opencontainers.image.description" = "Minimal Lix container image, with some batteries included."; + } // lib.optionalAttrs (lixRevision != null) { "org.opencontainers.image.revision" = lixRevision; }; + }; + + meta = { + description = "Docker image for Lix. This is built with nix2container; see that project's README for details"; + longDescription = '' + Docker image for Lix, built with nix2container. + To copy it to your docker daemon, nix run .#dockerImage.copyToDockerDaemon + To copy it to podman, nix run .#dockerImage.copyTo containers-storage:lix + ''; }; }; in @@ -379,12 +398,4 @@ image gzip $image echo "file binary-dist $image" >> $out/nix-support/hydra-build-products ''; - meta = image.meta // { - description = "Docker image for Lix. This is built with nix2container; see that project's README for details"; - longDescription = '' - Docker image for Lix, built with nix2container. - To copy it to your docker daemon, nix run .#dockerImage.copyToDockerDaemon - To copy it to podman, nix run .#dockerImage.copyTo containers-storage:lix - ''; - }; } |