From dd465ef1f391ba1f82849e96519834895db09a76 Mon Sep 17 00:00:00 2001 From: Ellis Clayton Date: Tue, 3 Dec 2019 10:06:05 +1100 Subject: [PATCH 1/2] Allow pass helper to be built for macOS Pass is described as "The Standard Unix Password Manager", and so it can easily run on more than just Linux. Namely, it's supported on macOS. The CLI is identical to the Linux build, which means the Linux helper code for Pass is fully applicable toward the macOS build - a couple of renames being the only needed thing, purely for semantic correctness. Signed-off-by: Ellis Clayton Signed-off-by: Sebastiaan van Stijn --- Makefile | 1 + pass/pass.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 36f8a76..d4fb62b 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,7 @@ linuxrelease: osxrelease: mkdir -p release cd bin && tar cvfz ../release/docker-credential-osxkeychain-v$(VERSION)-amd64.tar.gz docker-credential-osxkeychain + cd bin && tar cvfz ../release/docker-credential-pass-v$(VERSION)-darwin-amd64.tar.gz docker-credential-pass winrelease: mkdir -p release diff --git a/pass/pass.go b/pass/pass.go index 6cce15d..ab5f27a 100644 --- a/pass/pass.go +++ b/pass/pass.go @@ -22,7 +22,7 @@ import ( // PASS_FOLDER contains the directory where credentials are stored const PASS_FOLDER = "docker-credential-helpers" //nolint:revive -// Pass handles secrets using Linux secret-service as a store. +// Pass handles secrets using pass as a store. type Pass struct{} // Ideally these would be stored as members of Pass, but since all of Pass's From cc29c66bcc39bad4a0aa3f04bcccd49529f91c40 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 20 Aug 2022 21:07:55 +0200 Subject: [PATCH 2/2] Dockerfile: build pass on macOS Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index f6358cb..78bd902 100644 --- a/Dockerfile +++ b/Dockerfile @@ -109,6 +109,7 @@ RUN --mount=type=bind,target=. \ EOT FROM base AS build-darwin +ARG TARGETOS ARG TARGETARCH ARG TARGETVARIANT RUN --mount=type=bind,target=. \ @@ -121,6 +122,9 @@ RUN --mount=type=bind,target=. \ xx-go install std xx-go build -ldflags "$(cat /tmp/.ldflags)" -o /out/docker-credential-osxkeychain-${TARGETARCH}${TARGETVARIANT} ./osxkeychain/cmd/ xx-verify /out/docker-credential-osxkeychain-${TARGETARCH}${TARGETVARIANT} + + xx-go build -ldflags "$(cat /tmp/.ldflags)" -o /out/docker-credential-pass-${TARGETOS}-${TARGETARCH}${TARGETVARIANT} ./pass/cmd/ + xx-verify /out/docker-credential-pass-${TARGETOS}-${TARGETARCH}${TARGETVARIANT} EOT FROM base AS build-windows