@@ -5,6 +5,7 @@ ARG XX_VERSION=1.2.1
5
5
ARG OSXCROSS_VERSION=11.3-r7-debian
6
6
ARG GOLANGCI_LINT_VERSION=v1.51.1
7
7
ARG DEBIAN_FRONTEND=noninteractive
8
+ ARG GOPASS_VERSION=v1.15.5
8
9
9
10
ARG PACKAGE=github.com/docker/docker-credential-helpers
10
11
@@ -68,12 +69,19 @@ RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev p
68
69
69
70
FROM base AS test
70
71
ARG DEBIAN_FRONTEND
72
+ ARG GOPASS_VERSION
71
73
RUN xx-apt-get install -y dbus-x11 gnome-keyring gpg-agent gpgconf libsecret-1-dev pass
74
+ RUN --mount=type=bind,target=. \
75
+ --mount=type=cache,target=/root/.cache \
76
+ --mount=type=cache,target=/go/pkg/mod \
77
+ GOFLAGS='' go install github.com/gopasspw/gopass@${GOPASS_VERSION}
72
78
RUN --mount=type=bind,target=. \
73
79
--mount=type=cache,target=/root/.cache \
74
80
--mount=type=cache,target=/go/pkg/mod <<EOT
75
81
set -e
82
+
76
83
cp -r .github/workflows/fixtures /root/.gnupg
84
+ chmod 0400 /root/.gnupg
77
85
gpg-connect-agent "RELOADAGENT" /bye
78
86
gpg --import --batch --yes /root/.gnupg/7D851EB72D73BDA0.key
79
87
gpg --update-trustdb
@@ -82,7 +90,20 @@ RUN --mount=type=bind,target=. \
82
90
gpg-connect-agent "KEYINFO 3E2D1142AA59E08E16B7E2C64BA6DDC773B1A627" /bye
83
91
gpg-connect-agent "PRESET_PASSPHRASE BA83FC8947213477F28ADC019F6564A956456163 -1 77697468207374757069642070617373706872617365" /bye
84
92
gpg-connect-agent "KEYINFO BA83FC8947213477F28ADC019F6564A956456163" /bye
93
+
94
+ # initialize password store for `pass`
85
95
pass init 7D851EB72D73BDA0
96
+
97
+ # initialize password store for `gopass`
98
+ gopass config mounts.path /root/.gopass-password-store 1>/dev/null
99
+ gopass config core.autopush false 1>/dev/null
100
+ gopass config core.autosync false 1>/dev/null
101
+ gopass config core.exportkeys false 1>/dev/null
102
+ gopass config core.notifications false 1>/dev/null
103
+ gopass config core.color false 1>/dev/null
104
+ gopass config core.nopager true 1>/dev/null
105
+ gopass init --crypto gpgcli --storage fs 7D851EB72D73BDA0
106
+
86
107
gpg -k
87
108
88
109
mkdir /out
@@ -106,7 +127,8 @@ RUN --mount=type=bind,target=. \
106
127
--mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT
107
128
set -ex
108
129
xx-go --wrap
109
- make build-pass build-secretservice PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
130
+ make build-gopass build-pass build-secretservice PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
131
+ xx-verify /out/docker-credential-gopass
110
132
xx-verify /out/docker-credential-pass
111
133
xx-verify /out/docker-credential-secretservice
112
134
EOT
@@ -123,7 +145,8 @@ RUN --mount=type=bind,target=. \
123
145
export MACOSX_VERSION_MIN=$(make print-MACOSX_DEPLOYMENT_TARGET)
124
146
xx-go --wrap
125
147
go install std
126
- make build-osxkeychain build-pass PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
148
+ make build-gopass build-osxkeychain build-pass PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
149
+ xx-verify /out/docker-credential-gopass
127
150
xx-verify /out/docker-credential-osxkeychain
128
151
xx-verify /out/docker-credential-pass
129
152
EOT
@@ -137,7 +160,9 @@ RUN --mount=type=bind,target=. \
137
160
--mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT
138
161
set -ex
139
162
xx-go --wrap
140
- make build-wincred PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
163
+ make build-gopass build-wincred PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
164
+ mv /out/docker-credential-gopass /out/docker-credential-gopass.exe
165
+ xx-verify /out/docker-credential-gopass.exe
141
166
mv /out/docker-credential-wincred /out/docker-credential-wincred.exe
142
167
xx-verify /out/docker-credential-wincred.exe
143
168
EOT
0 commit comments