From d944f3e18ebfb3fbb4b37d654651a73b18c8c4d2 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Mon, 28 Aug 2023 19:28:34 -0500 Subject: [PATCH] use git version of regclient for compressed tar support --- flake.nix | 32 ++++++++++++++++++++++++++++++++ regctl-push-container.nu | 8 ++++---- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index a5ed5ac..dcc066d 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,38 @@ config.permittedInsecurePackages = [ "nodejs-16.20.2" ]; + overlays = [ + ( + self: super: { + regclient = + let + pname = "regclient"; + version = "0.5.1+"; + src = pkgs.fetchFromGitHub { + owner = "regclient"; + repo = "regclient"; + rev = "72df49963a17092138854c5d9d7943deac1dde6b"; + hash = "sha256-9k1VXtaHTF1GMIDs5qGzJkqPZa+ZKrWes+LakVKaQ38="; + }; + vendorHash = "sha256-j+XidIgjJ5uw1d4OXRl3pjiW5Hvy7WqNM0KdVWMvWls="; + in + super.buildGoModule { + inherit pname version src vendorHash; + inherit (super.regclient) meta outputs postInstall; + ldflags = [ + "-s" + "-w" + "-X main.VCSTag=v${version}" + ]; + }; + # super.regclient.overrideAttrs ( + # old: { + # inherit pname version src vendorHash; + # } + # ); + } + ) + ]; }; lib = pkgs.lib; docker-client = pkgs.docker_24.override { diff --git a/regctl-push-container.nu b/regctl-push-container.nu index 85ec486..ed8ec34 100644 --- a/regctl-push-container.nu +++ b/regctl-push-container.nu @@ -125,11 +125,11 @@ def main [ regctl registry login $registry --user $auth.username --pass $auth.password - print "decompressing image: start" + # print "decompressing image: start" - open $input | gzip --decompress | save --force --progress $"($input).tar" + # open $input | gzip --decompress | save --force --progress $"($input).tar" - print "decompressing image: stop" + # print "decompressing image: stop" # let load_result = (do { regctl load --input $input } | complete) # if $load_result.exit_code != 0 { @@ -144,7 +144,7 @@ def main [ if $item.index == 0 { let new_image = $"($registry)/($repository):($item.item)" print $"Pushing ($new_image)" - regctl image import $new_image $"($input).tar" + regctl image import $new_image $input # let tag_result = (do { regctl image import $new_image $"($input).tar" } | complete) # if $tag_result.exit_code != 0 { # print $tag_result.stderr