Add multiarch image make target

Updates #3112

Signed-off-by: Mangirdas <mangirdas@judeikis.lt>
This commit is contained in:
Mangirdas 2021-10-28 13:51:09 +03:00 committed by Brad Fitzpatrick
parent 649f7556e8
commit f771327f0c
2 changed files with 8 additions and 1 deletions

View File

@ -48,8 +48,9 @@ ARG VERSION_SHORT=""
ENV VERSION_SHORT=$VERSION_SHORT ENV VERSION_SHORT=$VERSION_SHORT
ARG VERSION_GIT_HASH="" ARG VERSION_GIT_HASH=""
ENV VERSION_GIT_HASH=$VERSION_GIT_HASH ENV VERSION_GIT_HASH=$VERSION_GIT_HASH
ARG TARGETARCH
RUN go install -tags=xversion -ldflags="\ RUN GOARCH=$TARGETARCH go install -tags=xversion -ldflags="\
-X tailscale.com/version.Long=$VERSION_LONG \ -X tailscale.com/version.Long=$VERSION_LONG \
-X tailscale.com/version.Short=$VERSION_SHORT \ -X tailscale.com/version.Short=$VERSION_SHORT \
-X tailscale.com/version.GitCommit=$VERSION_GIT_HASH" \ -X tailscale.com/version.GitCommit=$VERSION_GIT_HASH" \

View File

@ -1,3 +1,5 @@
IMAGE_REPO ?= tailscale/tailscale
usage: usage:
echo "See Makefile" echo "See Makefile"
@ -21,6 +23,10 @@ build386:
buildlinuxarm: buildlinuxarm:
GOOS=linux GOARCH=arm go install tailscale.com/cmd/tailscale tailscale.com/cmd/tailscaled GOOS=linux GOARCH=arm go install tailscale.com/cmd/tailscale tailscale.com/cmd/tailscaled
buildmultiarchimage:
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t ${IMAGE_REPO}:latest --push -f Dockerfile .
check: staticcheck vet depaware buildwindows build386 buildlinuxarm check: staticcheck vet depaware buildwindows build386 buildlinuxarm
staticcheck: staticcheck: