diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-03-15 23:10:23 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-03-16 09:30:48 -0400 |
commit | cad10c54f287a673623c148a9ab015b1f4071b5d (patch) | |
tree | e2f712a160cbff73fc4fc71d0e86002535eef628 | |
parent | 98daf1fa937643a1a155e0de3f2ebdadc57da27f (diff) | |
download | meta-virtualization-cad10c54f287a673623c148a9ab015b1f4071b5d.tar.gz |
k3s: add additional build tags
To more closely align with the rancher/upstream build, we add
additional tags to the build. To make them easier to manage, we
also introduce a variable and use it in the go build line.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r-- | recipes-containers/k3s/k3s_git.bb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/recipes-containers/k3s/k3s_git.bb b/recipes-containers/k3s/k3s_git.bb index 6c11f9c2..28d6ce0c 100644 --- a/recipes-containers/k3s/k3s_git.bb +++ b/recipes-containers/k3s/k3s_git.bb | |||
@@ -40,8 +40,12 @@ do_compile() { | |||
40 | export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" | 40 | export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" |
41 | export CGO_ENABLED="1" | 41 | export CGO_ENABLED="1" |
42 | export GOFLAGS="-mod=vendor" | 42 | export GOFLAGS="-mod=vendor" |
43 | |||
44 | TAGS="static_build ctrd no_btrfs netcgo osusergo providerless" | ||
45 | |||
43 | cd ${S}/src/import | 46 | cd ${S}/src/import |
44 | ${GO} build -tags providerless -ldflags "${GO_BUILD_LDFLAGS}" -o ./dist/artifacts/k3s ./cmd/server/main.go | 47 | ${GO} build -tags "$TAGS" -ldflags "${GO_BUILD_LDFLAGS} -w -s" -o ./dist/artifacts/k3s ./cmd/server/main.go |
48 | |||
45 | # Use UPX if it is enabled (and thus exists) to compress binary | 49 | # Use UPX if it is enabled (and thus exists) to compress binary |
46 | if command -v upx > /dev/null 2>&1; then | 50 | if command -v upx > /dev/null 2>&1; then |
47 | upx -9 ./dist/artifacts/k3s | 51 | upx -9 ./dist/artifacts/k3s |