mirror of
https://github.com/alibaba/higress.git
synced 2026-06-08 20:27:31 +08:00
feat: Support pushing multi-arch images to a custom image registry (#1815)
This commit is contained in:
487
.github/workflows/build-image-and-push.yaml
vendored
487
.github/workflows/build-image-and-push.yaml
vendored
@@ -1,229 +1,258 @@
|
|||||||
name: Build Docker Images and Push to Image Registry
|
name: Build Docker Images and Push to Image Registry
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "v*.*.*"
|
- "v*.*.*"
|
||||||
workflow_dispatch: ~
|
workflow_dispatch: ~
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-controller-image:
|
build-controller-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment:
|
environment:
|
||||||
name: image-registry-controller
|
name: image-registry-controller
|
||||||
env:
|
env:
|
||||||
CONTROLLER_IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }}
|
CONTROLLER_IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }}
|
||||||
CONTROLLER_IMAGE_NAME: ${{ vars.CONTROLLER_IMAGE_NAME || 'higress/higress' }}
|
CONTROLLER_IMAGE_NAME: ${{ vars.CONTROLLER_IMAGE_NAME || 'higress/higress' }}
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout ${{ github.ref }}"
|
- name: "Checkout ${{ github.ref }}"
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
|
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
|
||||||
uses: jlumbroso/free-disk-space@main
|
uses: jlumbroso/free-disk-space@main
|
||||||
with:
|
with:
|
||||||
tool-cache: false
|
tool-cache: false
|
||||||
android: true
|
android: true
|
||||||
dotnet: true
|
dotnet: true
|
||||||
haskell: true
|
haskell: true
|
||||||
large-packages: true
|
large-packages: true
|
||||||
swap-storage: true
|
swap-storage: true
|
||||||
|
|
||||||
- name: "Setup Go"
|
- name: "Setup Go"
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.21.5
|
go-version: 1.21.5
|
||||||
|
|
||||||
- name: Setup Golang Caches
|
- name: Setup Golang Caches
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |-
|
path: |-
|
||||||
~/.cache/go-build
|
~/.cache/go-build
|
||||||
~/go/pkg/mod
|
~/go/pkg/mod
|
||||||
key: ${{ runner.os }}-go-${{ github.run_id }}
|
key: ${{ runner.os }}-go-${{ github.run_id }}
|
||||||
restore-keys: ${{ runner.os }}-go
|
restore-keys: ${{ runner.os }}-go
|
||||||
|
|
||||||
- name: Calculate Docker metadata
|
- name: Calculate Docker metadata
|
||||||
id: docker-meta
|
id: docker-meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
${{ env.CONTROLLER_IMAGE_REGISTRY }}/${{ env.CONTROLLER_IMAGE_NAME }}
|
${{ env.CONTROLLER_IMAGE_REGISTRY }}/${{ env.CONTROLLER_IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=sha
|
type=sha
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
||||||
|
|
||||||
- name: Login to Docker Registry
|
- name: Login to Docker Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.CONTROLLER_IMAGE_REGISTRY }}
|
registry: ${{ env.CONTROLLER_IMAGE_REGISTRY }}
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
- name: Build Docker Image and Push
|
- name: Build Docker Image and Push
|
||||||
run: |
|
run: |
|
||||||
GOPROXY="https://proxy.golang.org,direct" make docker-buildx-push
|
BUILT_IMAGE=""
|
||||||
BUILT_IMAGE="higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/higress"
|
readarray -t IMAGES <<< "${{ steps.docker-meta.outputs.tags }}"
|
||||||
readarray -t IMAGES <<< "${{ steps.docker-meta.outputs.tags }}"
|
for image in ${IMAGES[@]}; do
|
||||||
for image in ${IMAGES[@]}; do
|
echo "Image: $image"
|
||||||
echo "Image: $image"
|
if [ "$BUILT_IMAGE" == "" ]; then
|
||||||
docker buildx imagetools create $BUILT_IMAGE:$GITHUB_SHA --tag $image
|
GOPROXY="https://proxy.golang.org,direct" IMG_URL="$image" make docker-buildx-push
|
||||||
done
|
BUILT_IMAGE="$image"
|
||||||
|
else
|
||||||
build-pilot-image:
|
docker buildx imagetools create $BUILT_IMAGE --tag $image
|
||||||
runs-on: ubuntu-latest
|
fi
|
||||||
environment:
|
done
|
||||||
name: image-registry-pilot
|
|
||||||
env:
|
build-pilot-image:
|
||||||
PILOT_IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }}
|
runs-on: ubuntu-latest
|
||||||
PILOT_IMAGE_NAME: ${{ vars.PILOT_IMAGE_NAME || 'higress/pilot' }}
|
environment:
|
||||||
steps:
|
name: image-registry-pilot
|
||||||
- name: "Checkout ${{ github.ref }}"
|
env:
|
||||||
uses: actions/checkout@v4
|
PILOT_IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }}
|
||||||
with:
|
PILOT_IMAGE_NAME: ${{ vars.PILOT_IMAGE_NAME || 'higress/pilot' }}
|
||||||
fetch-depth: 1
|
steps:
|
||||||
|
- name: "Checkout ${{ github.ref }}"
|
||||||
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
|
uses: actions/checkout@v4
|
||||||
uses: jlumbroso/free-disk-space@main
|
with:
|
||||||
with:
|
fetch-depth: 1
|
||||||
tool-cache: false
|
|
||||||
android: true
|
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
|
||||||
dotnet: true
|
uses: jlumbroso/free-disk-space@main
|
||||||
haskell: true
|
with:
|
||||||
large-packages: true
|
tool-cache: false
|
||||||
swap-storage: true
|
android: true
|
||||||
|
dotnet: true
|
||||||
- name: "Setup Go"
|
haskell: true
|
||||||
uses: actions/setup-go@v5
|
large-packages: true
|
||||||
with:
|
swap-storage: true
|
||||||
go-version: 1.21.5
|
|
||||||
|
- name: "Setup Go"
|
||||||
- name: Setup Golang Caches
|
uses: actions/setup-go@v5
|
||||||
uses: actions/cache@v4
|
with:
|
||||||
with:
|
go-version: 1.21.5
|
||||||
path: |-
|
|
||||||
~/.cache/go-build
|
- name: Setup Golang Caches
|
||||||
~/go/pkg/mod
|
uses: actions/cache@v4
|
||||||
key: ${{ runner.os }}-go-${{ github.run_id }}
|
with:
|
||||||
restore-keys: ${{ runner.os }}-go
|
path: |-
|
||||||
|
~/.cache/go-build
|
||||||
- name: Set up Docker Buildx
|
~/go/pkg/mod
|
||||||
uses: docker/setup-buildx-action@v1
|
key: ${{ runner.os }}-go-${{ github.run_id }}
|
||||||
|
restore-keys: ${{ runner.os }}-go
|
||||||
- name: Cache Docker layers
|
|
||||||
uses: actions/cache@v2
|
- name: Set up QEMU
|
||||||
with:
|
uses: docker/setup-qemu-action@v3
|
||||||
path: /tmp/.buildx-cache
|
with:
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
image: tonistiigi/binfmt:qemu-v7.0.0
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-buildx-
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Calculate Docker metadata
|
|
||||||
id: docker-meta
|
- name: Cache Docker layers
|
||||||
uses: docker/metadata-action@v5
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
images: |
|
path: /tmp/.buildx-cache
|
||||||
${{ env.PILOT_IMAGE_REGISTRY }}/${{ env.PILOT_IMAGE_NAME }}
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
tags: |
|
restore-keys: |
|
||||||
type=sha
|
${{ runner.os }}-buildx-
|
||||||
type=ref,event=tag
|
|
||||||
type=semver,pattern={{version}}
|
- name: Calculate Docker metadata
|
||||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
id: docker-meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
- name: Login to Docker Registry
|
with:
|
||||||
uses: docker/login-action@v3
|
images: |
|
||||||
with:
|
${{ env.PILOT_IMAGE_REGISTRY }}/${{ env.PILOT_IMAGE_NAME }}
|
||||||
registry: ${{ env.PILOT_IMAGE_REGISTRY }}
|
tags: |
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
type=sha
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
type=ref,event=tag
|
||||||
|
type=semver,pattern={{version}}
|
||||||
- name: Build Pilot-Discovery Image and Push
|
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
||||||
run: |
|
|
||||||
GOPROXY="https://proxy.golang.org,direct" make build-istio
|
- name: Login to Docker Registry
|
||||||
BUILT_IMAGE="higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/pilot"
|
uses: docker/login-action@v3
|
||||||
readarray -t IMAGES <<< "${{ steps.docker-meta.outputs.tags }}"
|
with:
|
||||||
for image in ${IMAGES[@]}; do
|
registry: ${{ env.PILOT_IMAGE_REGISTRY }}
|
||||||
echo "Image: $image"
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
docker buildx imagetools create $BUILT_IMAGE:$GITHUB_SHA --tag $image
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
done
|
|
||||||
|
- name: Build Pilot-Discovery Image and Push
|
||||||
|
run: |
|
||||||
build-gateway-image:
|
BUILT_IMAGE=""
|
||||||
runs-on: ubuntu-latest
|
readarray -t IMAGES <<< "${{ steps.docker-meta.outputs.tags }}"
|
||||||
environment:
|
for image in ${IMAGES[@]}; do
|
||||||
name: image-registry-pilot
|
echo "Image: $image"
|
||||||
env:
|
if [ "$BUILT_IMAGE" == "" ]; then
|
||||||
GATEWAY_IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }}
|
TAG=${image#*:}
|
||||||
GATEWAY_IMAGE_NAME: ${{ vars.GATEWAY_IMAGE_NAME || 'higress/gateway' }}
|
HUB=${image%:*}
|
||||||
steps:
|
HUB=${HUB%/*}
|
||||||
- name: "Checkout ${{ github.ref }}"
|
BUILT_IMAGE="$HUB/pilot:$TAG"
|
||||||
uses: actions/checkout@v4
|
GOPROXY="https://proxy.golang.org,direct" IMG_URL="$BUILT_IMAGE" make build-istio
|
||||||
with:
|
fi
|
||||||
fetch-depth: 1
|
if [ "$BUILT_IMAGE" != "$image" ]; then
|
||||||
|
docker buildx imagetools create $BUILT_IMAGE --tag $image
|
||||||
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
|
fi
|
||||||
uses: jlumbroso/free-disk-space@main
|
done
|
||||||
with:
|
|
||||||
tool-cache: false
|
build-gateway-image:
|
||||||
android: true
|
runs-on: ubuntu-latest
|
||||||
dotnet: true
|
environment:
|
||||||
haskell: true
|
name: image-registry-gateway
|
||||||
large-packages: true
|
env:
|
||||||
swap-storage: true
|
GATEWAY_IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }}
|
||||||
|
GATEWAY_IMAGE_NAME: ${{ vars.GATEWAY_IMAGE_NAME || 'higress/gateway' }}
|
||||||
- name: "Setup Go"
|
steps:
|
||||||
uses: actions/setup-go@v5
|
- name: "Checkout ${{ github.ref }}"
|
||||||
with:
|
uses: actions/checkout@v4
|
||||||
go-version: 1.21.5
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
- name: Setup Golang Caches
|
|
||||||
uses: actions/cache@v4
|
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
|
||||||
with:
|
uses: jlumbroso/free-disk-space@main
|
||||||
path: |-
|
with:
|
||||||
~/.cache/go-build
|
tool-cache: false
|
||||||
~/go/pkg/mod
|
android: true
|
||||||
key: ${{ runner.os }}-go-${{ github.run_id }}
|
dotnet: true
|
||||||
restore-keys: ${{ runner.os }}-go
|
haskell: true
|
||||||
|
large-packages: true
|
||||||
- name: Set up Docker Buildx
|
swap-storage: true
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
|
- name: "Setup Go"
|
||||||
- name: Cache Docker layers
|
uses: actions/setup-go@v5
|
||||||
uses: actions/cache@v2
|
with:
|
||||||
with:
|
go-version: 1.21.5
|
||||||
path: /tmp/.buildx-cache
|
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
- name: Setup Golang Caches
|
||||||
restore-keys: |
|
uses: actions/cache@v4
|
||||||
${{ runner.os }}-buildx-
|
with:
|
||||||
|
path: |-
|
||||||
- name: Calculate Docker metadata
|
~/.cache/go-build
|
||||||
id: docker-meta
|
~/go/pkg/mod
|
||||||
uses: docker/metadata-action@v5
|
key: ${{ runner.os }}-go-${{ github.run_id }}
|
||||||
with:
|
restore-keys: ${{ runner.os }}-go
|
||||||
images: |
|
|
||||||
${{ env.GATEWAY_IMAGE_REGISTRY }}/${{ env.GATEWAY_IMAGE_NAME }}
|
- name: Set up QEMU
|
||||||
tags: |
|
uses: docker/setup-qemu-action@v3
|
||||||
type=sha
|
with:
|
||||||
type=ref,event=tag
|
image: tonistiigi/binfmt:qemu-v7.0.0
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Login to Docker Registry
|
|
||||||
uses: docker/login-action@v3
|
- name: Cache Docker layers
|
||||||
with:
|
uses: actions/cache@v2
|
||||||
registry: ${{ env.GATEWAY_IMAGE_REGISTRY }}
|
with:
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
path: /tmp/.buildx-cache
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
- name: Build Gateway Image and Push
|
${{ runner.os }}-buildx-
|
||||||
run: |
|
|
||||||
GOPROXY="https://proxy.golang.org,direct" make build-gateway
|
- name: Calculate Docker metadata
|
||||||
BUILT_IMAGE="higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/proxyv2"
|
id: docker-meta
|
||||||
readarray -t IMAGES <<< "${{ steps.docker-meta.outputs.tags }}"
|
uses: docker/metadata-action@v5
|
||||||
for image in ${IMAGES[@]}; do
|
with:
|
||||||
echo "Image: $image"
|
images: |
|
||||||
docker buildx imagetools create $BUILT_IMAGE:$GITHUB_SHA --tag $image
|
${{ env.GATEWAY_IMAGE_REGISTRY }}/${{ env.GATEWAY_IMAGE_NAME }}
|
||||||
done
|
tags: |
|
||||||
|
type=sha
|
||||||
|
type=ref,event=tag
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
||||||
|
|
||||||
|
- name: Login to Docker Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.GATEWAY_IMAGE_REGISTRY }}
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build Gateway Image and Push
|
||||||
|
run: |
|
||||||
|
BUILT_IMAGE=""
|
||||||
|
readarray -t IMAGES <<< "${{ steps.docker-meta.outputs.tags }}"
|
||||||
|
for image in ${IMAGES[@]}; do
|
||||||
|
echo "Image: $image"
|
||||||
|
if [ "$BUILT_IMAGE" == "" ]; then
|
||||||
|
TAG=${image#*:}
|
||||||
|
HUB=${image%:*}
|
||||||
|
HUB=${HUB%/*}
|
||||||
|
BUILT_IMAGE="$HUB/proxyv2:$TAG"
|
||||||
|
GOPROXY="https://proxy.golang.org,direct" IMG_URL="$BUILT_IMAGE" make build-gateway
|
||||||
|
fi
|
||||||
|
if [ "$BUILT_IMAGE" != "$image" ]; then
|
||||||
|
docker buildx imagetools create $BUILT_IMAGE --tag $image
|
||||||
|
fi
|
||||||
|
done
|
||||||
@@ -162,13 +162,13 @@ buildx-prepare:
|
|||||||
build-gateway: prebuild buildx-prepare
|
build-gateway: prebuild buildx-prepare
|
||||||
USE_REAL_USER=1 TARGET_ARCH=amd64 DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh init
|
USE_REAL_USER=1 TARGET_ARCH=amd64 DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh init
|
||||||
USE_REAL_USER=1 TARGET_ARCH=arm64 DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh init
|
USE_REAL_USER=1 TARGET_ARCH=arm64 DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh init
|
||||||
DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh docker.buildx
|
DOCKER_TARGETS="docker.proxyv2" IMG_URL="${IMG_URL}" ./tools/hack/build-istio-image.sh docker.buildx
|
||||||
|
|
||||||
build-gateway-local: prebuild
|
build-gateway-local: prebuild
|
||||||
TARGET_ARCH=${TARGET_ARCH} DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh docker
|
TARGET_ARCH=${TARGET_ARCH} DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh docker
|
||||||
|
|
||||||
build-istio: prebuild buildx-prepare
|
build-istio: prebuild buildx-prepare
|
||||||
DOCKER_TARGETS="docker.pilot" ./tools/hack/build-istio-image.sh docker.buildx
|
DOCKER_TARGETS="docker.pilot" IMG_URL="${IMG_URL}" ./tools/hack/build-istio-image.sh docker.buildx
|
||||||
|
|
||||||
build-istio-local: prebuild
|
build-istio-local: prebuild
|
||||||
TARGET_ARCH=${TARGET_ARCH} DOCKER_TARGETS="docker.pilot" ./tools/hack/build-istio-image.sh docker
|
TARGET_ARCH=${TARGET_ARCH} DOCKER_TARGETS="docker.pilot" ./tools/hack/build-istio-image.sh docker
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ DOCKER_ALL_VARIANTS ?= debug distroless
|
|||||||
INCLUDE_UNTAGGED_DEFAULT ?= false
|
INCLUDE_UNTAGGED_DEFAULT ?= false
|
||||||
DEFAULT_DISTRIBUTION=debug
|
DEFAULT_DISTRIBUTION=debug
|
||||||
|
|
||||||
HIGRESS_DOCKER_BUILDX_RULE ?= $(foreach VARIANT,$(DOCKER_BUILD_VARIANTS), time (mkdir -p $(HIGRESS_DOCKER_BUILD_TOP)/$@ && TARGET_ARCH=$(TARGET_ARCH) ./docker/docker-copy.sh $^ $(HIGRESS_DOCKER_BUILD_TOP)/$@ && cd $(HIGRESS_DOCKER_BUILD_TOP)/$@ $(BUILD_PRE) && docker buildx create --name higress --node higress0 --platform linux/amd64,linux/arm64 --use && docker buildx build --no-cache --platform linux/amd64,linux/arm64 $(BUILD_ARGS) --build-arg BASE_DISTRIBUTION=$(call normalize-tag,$(VARIANT)) -t $(HUB)/higress:$(TAG)$(call variant-tag,$(VARIANT)) -f Dockerfile.higress . --push ); )
|
IMG ?= higress
|
||||||
HIGRESS_DOCKER_RULE ?= $(foreach VARIANT,$(DOCKER_BUILD_VARIANTS), time (mkdir -p $(HIGRESS_DOCKER_BUILD_TOP)/$@ && TARGET_ARCH=$(TARGET_ARCH) ./docker/docker-copy.sh $^ $(HIGRESS_DOCKER_BUILD_TOP)/$@ && cd $(HIGRESS_DOCKER_BUILD_TOP)/$@ $(BUILD_PRE) && docker build $(BUILD_ARGS) --build-arg BASE_DISTRIBUTION=$(call normalize-tag,$(VARIANT)) -t $(HUB)/higress:$(TAG)$(call variant-tag,$(VARIANT)) -f Dockerfile.higress . ); )
|
IMG_URL ?= $(HUB)/$(IMG):$(TAG)
|
||||||
|
|
||||||
|
HIGRESS_DOCKER_BUILDX_RULE ?= $(foreach VARIANT,$(DOCKER_BUILD_VARIANTS), time (mkdir -p $(HIGRESS_DOCKER_BUILD_TOP)/$@ && TARGET_ARCH=$(TARGET_ARCH) ./docker/docker-copy.sh $^ $(HIGRESS_DOCKER_BUILD_TOP)/$@ && cd $(HIGRESS_DOCKER_BUILD_TOP)/$@ $(BUILD_PRE) && docker buildx create --name higress --node higress0 --platform linux/amd64,linux/arm64 --use && docker buildx build --no-cache --platform linux/amd64,linux/arm64 $(BUILD_ARGS) --build-arg BASE_DISTRIBUTION=$(call normalize-tag,$(VARIANT)) -t $(IMG_URL)$(call variant-tag,$(VARIANT)) -f Dockerfile.higress . --push ); )
|
||||||
|
HIGRESS_DOCKER_RULE ?= $(foreach VARIANT,$(DOCKER_BUILD_VARIANTS), time (mkdir -p $(HIGRESS_DOCKER_BUILD_TOP)/$@ && TARGET_ARCH=$(TARGET_ARCH) ./docker/docker-copy.sh $^ $(HIGRESS_DOCKER_BUILD_TOP)/$@ && cd $(HIGRESS_DOCKER_BUILD_TOP)/$@ $(BUILD_PRE) && docker build $(BUILD_ARGS) --build-arg BASE_DISTRIBUTION=$(call normalize-tag,$(VARIANT)) -t $(IMG_URL)$(call variant-tag,$(VARIANT)) -f Dockerfile.higress . ); )
|
||||||
|
|||||||
@@ -30,9 +30,11 @@ fi
|
|||||||
CONDITIONAL_HOST_MOUNTS+="--mount type=bind,source=${ROOT}/external/package,destination=/home/package "
|
CONDITIONAL_HOST_MOUNTS+="--mount type=bind,source=${ROOT}/external/package,destination=/home/package "
|
||||||
CONDITIONAL_HOST_MOUNTS+="--mount type=bind,source=${ROOT}/external/envoy,destination=/home/envoy "
|
CONDITIONAL_HOST_MOUNTS+="--mount type=bind,source=${ROOT}/external/envoy,destination=/home/envoy "
|
||||||
|
|
||||||
|
BUILD_TOOLS_IMG=${BUILD_TOOLS_IMG:-"higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/build-tools:release-1.19-ef344298e65eeb2d9e2d07b87eb4e715c2def613"}
|
||||||
|
|
||||||
BUILD_WITH_CONTAINER=1 \
|
BUILD_WITH_CONTAINER=1 \
|
||||||
CONDITIONAL_HOST_MOUNTS=${CONDITIONAL_HOST_MOUNTS} \
|
CONDITIONAL_HOST_MOUNTS=${CONDITIONAL_HOST_MOUNTS} \
|
||||||
BUILD_ENVOY_BINARY_ONLY=1 \
|
BUILD_ENVOY_BINARY_ONLY=1 \
|
||||||
DOCKER_RUN_OPTIONS="--user root -e HTTP_PROXY -e HTTPS_PROXY" \
|
DOCKER_RUN_OPTIONS="--user root -e HTTP_PROXY -e HTTPS_PROXY" \
|
||||||
IMG=higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/build-tools-proxy:release-1.19-ef344298e65eeb2d9e2d07b87eb4e715c2def613 \
|
IMG=${BUILD_TOOLS_IMG} \
|
||||||
make test_release
|
make test_release
|
||||||
|
|||||||
@@ -25,14 +25,34 @@ CONDITIONAL_HOST_MOUNTS+="--mount type=bind,source=${ROOT}/external/package,dest
|
|||||||
|
|
||||||
DOCKER_RUN_OPTIONS+="-e HTTP_PROXY -e HTTPS_PROXY"
|
DOCKER_RUN_OPTIONS+="-e HTTP_PROXY -e HTTPS_PROXY"
|
||||||
|
|
||||||
|
BUILD_TOOLS_IMG=${BUILD_TOOLS_IMG:-"higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/build-tools:release-1.19-ef344298e65eeb2d9e2d07b87eb4e715c2def613"}
|
||||||
|
|
||||||
|
ORIGINAL_HUB=${HUB}
|
||||||
|
|
||||||
|
echo "IMG_URL=$IMG_URL"
|
||||||
|
|
||||||
|
if [ -n "$IMG_URL" ]; then
|
||||||
|
TAG=${IMG_URL#*:}
|
||||||
|
HUB=${IMG_URL%:*}
|
||||||
|
HUB=${HUB%/*}
|
||||||
|
if [ "$TAG" == "${IMG_URL}" ]; then
|
||||||
|
TAG=latest
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "HUB=$HUB"
|
||||||
|
echo "TAG=$TAG"
|
||||||
|
|
||||||
GOOS_LOCAL=linux TARGET_OS=linux TARGET_ARCH=${TARGET_ARCH} \
|
GOOS_LOCAL=linux TARGET_OS=linux TARGET_ARCH=${TARGET_ARCH} \
|
||||||
ISTIO_ENVOY_LINUX_RELEASE_URL=${ISTIO_ENVOY_LINUX_RELEASE_URL} \
|
ISTIO_ENVOY_LINUX_RELEASE_URL=${ISTIO_ENVOY_LINUX_RELEASE_URL} \
|
||||||
BUILD_WITH_CONTAINER=1 \
|
BUILD_WITH_CONTAINER=1 \
|
||||||
USE_REAL_USER=${USE_REAL_USER:-0} \
|
USE_REAL_USER=${USE_REAL_USER:-0} \
|
||||||
CONDITIONAL_HOST_MOUNTS=${CONDITIONAL_HOST_MOUNTS} \
|
CONDITIONAL_HOST_MOUNTS=${CONDITIONAL_HOST_MOUNTS} \
|
||||||
DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="${DOCKER_TARGETS}" \
|
DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="${DOCKER_TARGETS}" \
|
||||||
ISTIO_BASE_REGISTRY="${HUB}" \
|
ISTIO_BASE_REGISTRY="${ORIGINAL_HUB}" \
|
||||||
BASE_VERSION="${HIGRESS_BASE_VERSION}" \
|
BASE_VERSION="${HIGRESS_BASE_VERSION}" \
|
||||||
DOCKER_RUN_OPTIONS=${DOCKER_RUN_OPTIONS} \
|
DOCKER_RUN_OPTIONS=${DOCKER_RUN_OPTIONS} \
|
||||||
IMG=higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/build-tools:release-1.19-ef344298e65eeb2d9e2d07b87eb4e715c2def613 \
|
HUB="${HUB}" \
|
||||||
|
TAG="${TAG}" \
|
||||||
|
IMG=${BUILD_TOOLS_IMG} \
|
||||||
make "$@"
|
make "$@"
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ set -euo pipefail
|
|||||||
source "$(dirname -- "$0")/setup-istio-env.sh"
|
source "$(dirname -- "$0")/setup-istio-env.sh"
|
||||||
|
|
||||||
cd ${ROOT}/external/istio
|
cd ${ROOT}/external/istio
|
||||||
rm -rf out/linux_${TARGET_ARCH};
|
rm -rf out/linux_${TARGET_ARCH};
|
||||||
|
|
||||||
|
BUILD_TOOLS_IMG=${BUILD_TOOLS_IMG:-"higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/build-tools:release-1.19-ef344298e65eeb2d9e2d07b87eb4e715c2def613"}
|
||||||
|
|
||||||
GOOS_LOCAL=linux TARGET_OS=linux TARGET_ARCH=${TARGET_ARCH} \
|
GOOS_LOCAL=linux TARGET_OS=linux TARGET_ARCH=${TARGET_ARCH} \
|
||||||
ISTIO_ENVOY_LINUX_RELEASE_URL=${ISTIO_ENVOY_LINUX_RELEASE_URL} \
|
ISTIO_ENVOY_LINUX_RELEASE_URL=${ISTIO_ENVOY_LINUX_RELEASE_URL} \
|
||||||
@@ -28,5 +30,5 @@ GOOS_LOCAL=linux TARGET_OS=linux TARGET_ARCH=${TARGET_ARCH} \
|
|||||||
ISTIO_BASE_REGISTRY="${HUB}" \
|
ISTIO_BASE_REGISTRY="${HUB}" \
|
||||||
BASE_VERSION="${HIGRESS_BASE_VERSION}" \
|
BASE_VERSION="${HIGRESS_BASE_VERSION}" \
|
||||||
DOCKER_RUN_OPTIONS="--user root -e HTTP_PROXY -e HTTPS_PROXY" \
|
DOCKER_RUN_OPTIONS="--user root -e HTTP_PROXY -e HTTPS_PROXY" \
|
||||||
IMG=higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/build-tools:release-1.19-ef344298e65eeb2d9e2d07b87eb4e715c2def613 \
|
IMG=${BUILD_TOOLS_IMG} \
|
||||||
make build-linux
|
make build-linux
|
||||||
|
|||||||
Reference in New Issue
Block a user