diff --git a/Makefile b/Makefile index 656cfb856de8..7c8291ac5bba 100644 --- a/Makefile +++ b/Makefile @@ -12,14 +12,14 @@ clean: ## remove build artifacts .PHONY: test-unit test-unit: ## run unit tests, to change the output format use: GOTESTSUM_FORMAT=(dots|short|standard-quiet|short-verbose|standard-verbose) make test-unit - gotestsum $(TESTFLAGS) -- $${TESTDIRS:-$(shell go list ./... | grep -vE '/vendor/|/e2e/')} + gotestsum $(TESTFLAGS) -- -tags osusergo $${TESTDIRS:-$(shell go list ./... | grep -vE '/vendor/|/e2e/')} .PHONY: test test: test-unit ## run tests .PHONY: test-coverage test-coverage: ## run test coverage - gotestsum -- -coverprofile=coverage.txt $(shell go list ./... | grep -vE '/vendor/|/e2e/') + gotestsum -- -tags osusergo -coverprofile=coverage.txt $(shell go list ./... | grep -vE '/vendor/|/e2e/') .PHONY: fmt fmt: diff --git a/scripts/build/binary b/scripts/build/binary index 41c4196cc801..2296459efd46 100755 --- a/scripts/build/binary +++ b/scripts/build/binary @@ -9,6 +9,6 @@ source ./scripts/build/.variables echo "Building statically linked $TARGET" export CGO_ENABLED=0 -go build -o "${TARGET}" --ldflags "${LDFLAGS}" "${SOURCE}" +go build -tags osusergo -o "${TARGET}" --ldflags "${LDFLAGS}" "${SOURCE}" ln -sf "$(basename "${TARGET}")" build/docker diff --git a/scripts/build/plugins b/scripts/build/plugins index fce2689cdc25..af7fefe1455d 100755 --- a/scripts/build/plugins +++ b/scripts/build/plugins @@ -17,5 +17,5 @@ for p in cli-plugins/examples/* "$@" ; do echo "Building statically linked $TARGET" export CGO_ENABLED=0 - go build -o "${TARGET}" --ldflags "${LDFLAGS}" "github.com/docker/cli/${p}" + go build -tags osusergo -o "${TARGET}" --ldflags "${LDFLAGS}" "github.com/docker/cli/${p}" done diff --git a/scripts/docs/generate-man.sh b/scripts/docs/generate-man.sh index 7412e5baa526..6e703ccab0a6 100755 --- a/scripts/docs/generate-man.sh +++ b/scripts/docs/generate-man.sh @@ -7,7 +7,7 @@ mkdir -p ./man/man1 go install ./vendor/github.com/cpuguy83/go-md2man # Generate man pages from cobra commands -go build -o /tmp/gen-manpages github.com/docker/cli/man +go build -tags osusergo -o /tmp/gen-manpages github.com/docker/cli/man /tmp/gen-manpages --root "$(pwd)" --target "$(pwd)/man/man1" # Generate legacy pages from markdown diff --git a/scripts/docs/generate-yaml.sh b/scripts/docs/generate-yaml.sh index 2a7b0a8980b9..73773f604a7e 100755 --- a/scripts/docs/generate-yaml.sh +++ b/scripts/docs/generate-yaml.sh @@ -4,5 +4,5 @@ set -eu -o pipefail mkdir -p docs/yaml/gen -go build -o build/yaml-docs-generator github.com/docker/cli/docs/yaml +go build -tags osusergo -o build/yaml-docs-generator github.com/docker/cli/docs/yaml build/yaml-docs-generator --root "$(pwd)" --target "$(pwd)/docs/yaml/gen"