From c005f673140fc2e03c91fc4a3886126879979f80 Mon Sep 17 00:00:00 2001 From: Maisem Ali Date: Sun, 21 Nov 2021 20:52:19 -0800 Subject: [PATCH] build_docker.sh: use github.com/tailscale/mkctr instead of docker Signed-off-by: Maisem Ali (cherry picked from commit 9feb483ad3b3bdcedf273f6fae7db58c36d71442) --- Dockerfile | 3 +-- Dockerfile.base | 6 ++++++ Makefile | 3 +-- build_dist.sh | 4 +++- build_docker.sh | 17 ++++++++++++----- 5 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 Dockerfile.base diff --git a/Dockerfile b/Dockerfile index 6a112df54..28c771641 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,6 +56,5 @@ RUN GOARCH=$TARGETARCH go install -tags=xversion -ldflags="\ -X tailscale.com/version.GitCommit=$VERSION_GIT_HASH" \ -v ./cmd/tailscale ./cmd/tailscaled -FROM alpine:3.14 -RUN apk add --no-cache ca-certificates iptables iproute2 ip6tables +FROM ghcr.io/tailscale/alpine-base:3.14 COPY --from=build-env /go/bin/* /usr/local/bin/ diff --git a/Dockerfile.base b/Dockerfile.base new file mode 100644 index 000000000..e77f52de1 --- /dev/null +++ b/Dockerfile.base @@ -0,0 +1,6 @@ +# Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +FROM alpine:3.14 +RUN apk add --no-cache ca-certificates iptables iproute2 ip6tables diff --git a/Makefile b/Makefile index c8262ee61..07a197b81 100644 --- a/Makefile +++ b/Makefile @@ -23,9 +23,8 @@ build386: buildlinuxarm: 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 . + ./build_docker.sh check: staticcheck vet depaware buildwindows build386 buildlinuxarm diff --git a/build_dist.sh b/build_dist.sh index 901c29b94..1fcf41aed 100755 --- a/build_dist.sh +++ b/build_dist.sh @@ -30,12 +30,14 @@ else fi long_suffix="$change_suffix-t$short_hash" -SHORT="$major.$minor.$patch" +MINOR="$major.$minor" +SHORT="$MINOR.$patch" LONG="${SHORT}$long_suffix" GIT_HASH="$git_hash" if [ "$1" = "shellvars" ]; then cat <