diff --git a/hack/test b/hack/test index fbc7759b0d0d..3287b356e717 100755 --- a/hack/test +++ b/hack/test @@ -111,7 +111,15 @@ if [ "$TEST_KEEP_CACHE" != "1" ]; then trap 'docker rm -v $cacheVolume' EXIT fi -baseCreateFlags="--rm --privileged \ +dockerConfigMount="" +if [ "$GITHUB_ACTIONS" = "true" ]; then + dockerConfigPath="$HOME/.docker/config.json" + if [ -f "$dockerConfigPath" ]; then + dockerConfigMount="-v $dockerConfigPath:/root/.docker/config.json:ro" + fi +fi + +baseCreateFlags="--rm --privileged $dockerConfigMount \ -v /tmp $testReportsVol \ --volumes-from=$cacheVolume \ -e CGO_ENABLED \