diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2022-09-13 11:25:46 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2022-09-13 11:25:46 -0400 |
commit | 7cea149bb0b510d2fb7fe71eee28d10399d0ceb4 (patch) | |
tree | 4193fcc0a3c56ddde0f8244634c4207b18a3a045 | |
parent | c991546a7f82b1a430413e241a7baf3dd632d1ae (diff) | |
download | meta-virtualization-7cea149bb0b510d2fb7fe71eee28d10399d0ceb4.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>
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. |