Skip to content

Commit 2a1cc96

Browse files
crazy-maxtonistiigi
authored andcommitted
hack: mount docker config on gha
Signed-off-by: CrazyMax <[email protected]>
1 parent 449856f commit 2a1cc96

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

hack/test

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,15 @@ if [ "$TEST_KEEP_CACHE" != "1" ]; then
107107
trap 'docker rm -v $cacheVolume' EXIT
108108
fi
109109

110-
baseCreateFlags="--rm --privileged \
110+
dockerConfigMount=""
111+
if [ "$GITHUB_ACTIONS" = "true" ]; then
112+
dockerConfigPath="$HOME/.docker/config.json"
113+
if [ -f "$dockerConfigPath" ]; then
114+
dockerConfigMount="-v $dockerConfigPath:/root/.docker/config.json:ro"
115+
fi
116+
fi
117+
118+
baseCreateFlags="--rm --privileged $dockerConfigMount \
111119
-v /tmp $testReportsVol \
112120
--volumes-from=$cacheVolume \
113121
-e CGO_ENABLED \

0 commit comments

Comments
 (0)