mirror of https://github.com/docker/buildx.git
hack: mount docker config on gha
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
4b5d78db9b
commit
d83af5133e
12
hack/test
12
hack/test
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
set -eu -o pipefail
|
set -eu -o pipefail
|
||||||
|
|
||||||
|
: "${GITHUB_ACTIONS=}"
|
||||||
|
|
||||||
: "${BUILDX_CMD=docker buildx}"
|
: "${BUILDX_CMD=docker buildx}"
|
||||||
|
|
||||||
: "${TEST_COVERAGE=}"
|
: "${TEST_COVERAGE=}"
|
||||||
|
@ -37,7 +39,15 @@ if [ "$TEST_COVERAGE" = "1" ]; then
|
||||||
export GO_TEST_COVERPROFILE="/testreports/coverage-report$TEST_REPORT_SUFFIX.txt"
|
export GO_TEST_COVERPROFILE="/testreports/coverage-report$TEST_REPORT_SUFFIX.txt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cid=$(docker create --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
|
||||||
|
|
||||||
|
cid=$(docker create --rm --privileged $dockerConfigMount \
|
||||||
-v /tmp $testReportsVol \
|
-v /tmp $testReportsVol \
|
||||||
--volumes-from=$cacheVolume \
|
--volumes-from=$cacheVolume \
|
||||||
-e GITHUB_REF \
|
-e GITHUB_REF \
|
||||||
|
|
Loading…
Reference in New Issue