diff --git a/.github/workflows/build-and-publish-images.yml b/.github/workflows/build-and-publish-images.yml index cb9f4d8b34f43..c20ecf4fbbc68 100644 --- a/.github/workflows/build-and-publish-images.yml +++ b/.github/workflows/build-and-publish-images.yml @@ -42,4 +42,18 @@ jobs: TAGS: ${{ github.ref_name }} run: | echo "Building and publishing tailscale client to ${REPO} with tags ${TAGS}" - TAGS="${TAGS}" REPOS=${REPO} PLATFORM=${PLATFORM} PUSH=true TARGET=client ./build_docker.sh + TAGS="${TAGS}" REPOS=${REPO} PLATFORM=${PLATFORM} PUSH=true TARGET=client ./build_docker.sh + - name: Build and publish derper image + env: + REPO: ghcr.io/${{ github.repository_owner }}/derper + TAGS: ${{ github.ref_name }} + run: | + echo "Building and publishing derper to ${REPO} with tags ${TAGS}" + TAGS="${TAGS}" REPOS=${REPO} PLATFORM=${PLATFORM} PUSH=true TARGET=derper ./build_docker.sh + - name: Build and publish derpprobe image + env: + REPO: ghcr.io/${{ github.repository_owner }}/derpprobe + TAGS: ${{ github.ref_name }} + run: | + echo "Building and publishing derpprobe to ${REPO} with tags ${TAGS}" + TAGS="${TAGS}" REPOS=${REPO} PLATFORM=${PLATFORM} PUSH=true TARGET=derpprobe ./build_docker.sh diff --git a/build_docker.sh b/build_docker.sh index 7840dc89775d3..d91bb9ba0a683 100755 --- a/build_docker.sh +++ b/build_docker.sh @@ -118,6 +118,42 @@ case "$TARGET" in --annotations="${ANNOTATIONS}" \ /usr/local/bin/tsidp ;; + derper) + DEFAULT_REPOS="tailscale/derper" + REPOS="${REPOS:-${DEFAULT_REPOS}}" + go run github.com/tailscale/mkctr \ + --gopaths="tailscale.com/cmd/derper:/usr/local/bin/derper" \ + --ldflags=" \ + -X tailscale.com/version.longStamp=${VERSION_LONG} \ + -X tailscale.com/version.shortStamp=${VERSION_SHORT} \ + -X tailscale.com/version.gitCommitStamp=${VERSION_GIT_HASH}" \ + --base="${BASE}" \ + --tags="${TAGS}" \ + --gotags="ts_package_container" \ + --repos="${REPOS}" \ + --push="${PUSH}" \ + --target="${PLATFORM}" \ + --annotations="${ANNOTATIONS}" \ + /usr/local/bin/derper + ;; + derpprobe) + DEFAULT_REPOS="tailscale/derpprobe" + REPOS="${REPOS:-${DEFAULT_REPOS}}" + go run github.com/tailscale/mkctr \ + --gopaths="tailscale.com/cmd/derpprobe:/usr/local/bin/derpprobe" \ + --ldflags=" \ + -X tailscale.com/version.longStamp=${VERSION_LONG} \ + -X tailscale.com/version.shortStamp=${VERSION_SHORT} \ + -X tailscale.com/version.gitCommitStamp=${VERSION_GIT_HASH}" \ + --base="${BASE}" \ + --tags="${TAGS}" \ + --gotags="ts_package_container" \ + --repos="${REPOS}" \ + --push="${PUSH}" \ + --target="${PLATFORM}" \ + --annotations="${ANNOTATIONS}" \ + /usr/local/bin/derpprobe + ;; *) echo "unknown target: $TARGET" exit 1