summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2022-12-12 08:58:48 +0100
committerBruce Ashfield <bruce.ashfield@gmail.com>2022-12-22 10:28:08 -0500
commit4bc82a1330a998345271b59f14e1c00b3e5e5cbb (patch)
tree67d998a65552c1c6f7780fb3e0fe315092fc8fc7
parent7c811b31dc34d666bfc06f4a55e5f0df77b88818 (diff)
downloadmeta-virtualization-4bc82a1330a998345271b59f14e1c00b3e5e5cbb.tar.gz
docker: reproducibility add -trimpath to go -> $GO patches
With this, we build and package docker without QA warnings due to references to TMPDIR. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/docker/files/0001-cli-use-external-GO111MODULE-and-cross-compiler.patch2
-rw-r--r--recipes-containers/docker/files/0001-dynbinary-use-go-cross-compiler.patch2
-rw-r--r--recipes-containers/docker/files/0001-libnetwork-use-GO-instead-of-go.patch10
3 files changed, 7 insertions, 7 deletions
diff --git a/recipes-containers/docker/files/0001-cli-use-external-GO111MODULE-and-cross-compiler.patch b/recipes-containers/docker/files/0001-cli-use-external-GO111MODULE-and-cross-compiler.patch
index 16b5f9e5..d68de1cf 100644
--- a/recipes-containers/docker/files/0001-cli-use-external-GO111MODULE-and-cross-compiler.patch
+++ b/recipes-containers/docker/files/0001-cli-use-external-GO111MODULE-and-cross-compiler.patch
@@ -19,6 +19,6 @@ Index: git/cli/scripts/build/binary
19-export GO111MODULE=auto 19-export GO111MODULE=auto
20 20
21-go build -o "${TARGET}" -tags "${GO_BUILDTAGS}" --ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "${SOURCE}" 21-go build -o "${TARGET}" -tags "${GO_BUILDTAGS}" --ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "${SOURCE}"
22+${GO} build -o "${TARGET}" -tags "${GO_BUILDTAGS}" --ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "${SOURCE}" 22+${GO} build -trimpath -o "${TARGET}" -tags "${GO_BUILDTAGS}" --ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "${SOURCE}"
23 23
24 ln -sf "$(basename "${TARGET}")" "$(dirname "${TARGET}")/docker" 24 ln -sf "$(basename "${TARGET}")" "$(dirname "${TARGET}")/docker"
diff --git a/recipes-containers/docker/files/0001-dynbinary-use-go-cross-compiler.patch b/recipes-containers/docker/files/0001-dynbinary-use-go-cross-compiler.patch
index 971c60d7..c6edaf46 100644
--- a/recipes-containers/docker/files/0001-dynbinary-use-go-cross-compiler.patch
+++ b/recipes-containers/docker/files/0001-dynbinary-use-go-cross-compiler.patch
@@ -17,7 +17,7 @@ Index: git/src/import/hack/make/.binary
17 echo "Building: $DEST/$BINARY_FULLNAME" 17 echo "Building: $DEST/$BINARY_FULLNAME"
18 echo "GOOS=\"${GOOS}\" GOARCH=\"${GOARCH}\" GOARM=\"${GOARM}\"" 18 echo "GOOS=\"${GOOS}\" GOARCH=\"${GOARCH}\" GOARM=\"${GOARM}\""
19- go build \ 19- go build \
20+ ${GO} build \ 20+ ${GO} build -trimpath \
21 -o "$DEST/$BINARY_FULLNAME" \ 21 -o "$DEST/$BINARY_FULLNAME" \
22 "${BUILDFLAGS[@]}" \ 22 "${BUILDFLAGS[@]}" \
23 -ldflags " 23 -ldflags "
diff --git a/recipes-containers/docker/files/0001-libnetwork-use-GO-instead-of-go.patch b/recipes-containers/docker/files/0001-libnetwork-use-GO-instead-of-go.patch
index c623b260..d4f84e30 100644
--- a/recipes-containers/docker/files/0001-libnetwork-use-GO-instead-of-go.patch
+++ b/recipes-containers/docker/files/0001-libnetwork-use-GO-instead-of-go.patch
@@ -22,9 +22,9 @@ Index: git/libnetwork/Makefile
22- go build -tags experimental -o "bin/dnet" ./cmd/dnet 22- go build -tags experimental -o "bin/dnet" ./cmd/dnet
23- go build -o "bin/docker-proxy" ./cmd/proxy 23- go build -o "bin/docker-proxy" ./cmd/proxy
24- CGO_ENABLED=0 go build -o "bin/diagnosticClient" ./cmd/diagnostic 24- CGO_ENABLED=0 go build -o "bin/diagnosticClient" ./cmd/diagnostic
25+ $(GO) build -tags experimental -o "bin/dnet" ./cmd/dnet 25+ $(GO) build -trimpath -tags experimental -o "bin/dnet" ./cmd/dnet
26+ $(GO) build -o "bin/proxy" ./cmd/proxy 26+ $(GO) build -trimpath -o "bin/proxy" ./cmd/proxy
27+ CGO_ENABLED=0 $(GO) build -o "bin/diagnosticClient" ./cmd/diagnostic 27+ CGO_ENABLED=0 $(GO) build -trimpath -o "bin/diagnosticClient" ./cmd/diagnostic
28 CGO_ENABLED=0 go build -o "bin/testMain" ./cmd/networkdb-test/testMain.go 28 CGO_ENABLED=0 go build -o "bin/testMain" ./cmd/networkdb-test/testMain.go
29 29
30 build-images: 30 build-images:
@@ -34,8 +34,8 @@ Index: git/libnetwork/Makefile
34 @echo "🐳 $@" 34 @echo "🐳 $@"
35- go build -o "bin/dnet-$$GOOS-$$GOARCH" ./cmd/dnet 35- go build -o "bin/dnet-$$GOOS-$$GOARCH" ./cmd/dnet
36- go build -o "bin/docker-proxy-$$GOOS-$$GOARCH" ./cmd/proxy 36- go build -o "bin/docker-proxy-$$GOOS-$$GOARCH" ./cmd/proxy
37+ @$(GO) build -linkshared $(GOBUILDFLAGS) -o "bin/docker-proxy-$$GOOS-$$GOARCH" ./cmd/proxy 37+ @$(GO) build -trimpath -linkshared $(GOBUILDFLAGS) -o "bin/docker-proxy-$$GOOS-$$GOARCH" ./cmd/proxy
38+ @$(GO) build -linkshared $(GOBUILDFLAGS) -o "bin/dnet-$$GOOS-$$GOARCH" ./cmd/dnet 38+ @$(GO) build -trimpath -linkshared $(GOBUILDFLAGS) -o "bin/dnet-$$GOOS-$$GOARCH" ./cmd/dnet
39 39
40 # Rebuild protocol buffers. 40 # Rebuild protocol buffers.
41 # These may need to be rebuilt after vendoring updates, so .proto files are declared .PHONY so they are always rebuilt. 41 # These may need to be rebuilt after vendoring updates, so .proto files are declared .PHONY so they are always rebuilt.