Skip to content

Commit 45fdd95

Browse files
authoredFeb 26, 2025

File tree

6 files changed

+293
-238
lines changed

6 files changed

+293
-238
lines changed
 
+258-229
Original file line numberDiff line numberDiff line change
@@ -1,229 +1,258 @@
1-
name: Build Docker Images and Push to Image Registry
2-
3-
on:
4-
push:
5-
tags:
6-
- "v*.*.*"
7-
workflow_dispatch: ~
8-
9-
jobs:
10-
build-controller-image:
11-
runs-on: ubuntu-latest
12-
environment:
13-
name: image-registry-controller
14-
env:
15-
CONTROLLER_IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }}
16-
CONTROLLER_IMAGE_NAME: ${{ vars.CONTROLLER_IMAGE_NAME || 'higress/higress' }}
17-
steps:
18-
- name: "Checkout ${{ github.ref }}"
19-
uses: actions/checkout@v4
20-
with:
21-
fetch-depth: 1
22-
23-
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
24-
uses: jlumbroso/free-disk-space@main
25-
with:
26-
tool-cache: false
27-
android: true
28-
dotnet: true
29-
haskell: true
30-
large-packages: true
31-
swap-storage: true
32-
33-
- name: "Setup Go"
34-
uses: actions/setup-go@v5
35-
with:
36-
go-version: 1.21.5
37-
38-
- name: Setup Golang Caches
39-
uses: actions/cache@v4
40-
with:
41-
path: |-
42-
~/.cache/go-build
43-
~/go/pkg/mod
44-
key: ${{ runner.os }}-go-${{ github.run_id }}
45-
restore-keys: ${{ runner.os }}-go
46-
47-
- name: Calculate Docker metadata
48-
id: docker-meta
49-
uses: docker/metadata-action@v5
50-
with:
51-
images: |
52-
${{ env.CONTROLLER_IMAGE_REGISTRY }}/${{ env.CONTROLLER_IMAGE_NAME }}
53-
tags: |
54-
type=sha
55-
type=ref,event=tag
56-
type=semver,pattern={{version}}
57-
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
58-
59-
- name: Login to Docker Registry
60-
uses: docker/login-action@v3
61-
with:
62-
registry: ${{ env.CONTROLLER_IMAGE_REGISTRY }}
63-
username: ${{ secrets.REGISTRY_USERNAME }}
64-
password: ${{ secrets.REGISTRY_PASSWORD }}
65-
66-
- name: Build Docker Image and Push
67-
run: |
68-
GOPROXY="https://proxy.golang.org,direct" make docker-buildx-push
69-
BUILT_IMAGE="higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/higress"
70-
readarray -t IMAGES <<< "${{ steps.docker-meta.outputs.tags }}"
71-
for image in ${IMAGES[@]}; do
72-
echo "Image: $image"
73-
docker buildx imagetools create $BUILT_IMAGE:$GITHUB_SHA --tag $image
74-
done
75-
76-
build-pilot-image:
77-
runs-on: ubuntu-latest
78-
environment:
79-
name: image-registry-pilot
80-
env:
81-
PILOT_IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }}
82-
PILOT_IMAGE_NAME: ${{ vars.PILOT_IMAGE_NAME || 'higress/pilot' }}
83-
steps:
84-
- name: "Checkout ${{ github.ref }}"
85-
uses: actions/checkout@v4
86-
with:
87-
fetch-depth: 1
88-
89-
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
90-
uses: jlumbroso/free-disk-space@main
91-
with:
92-
tool-cache: false
93-
android: true
94-
dotnet: true
95-
haskell: true
96-
large-packages: true
97-
swap-storage: true
98-
99-
- name: "Setup Go"
100-
uses: actions/setup-go@v5
101-
with:
102-
go-version: 1.21.5
103-
104-
- name: Setup Golang Caches
105-
uses: actions/cache@v4
106-
with:
107-
path: |-
108-
~/.cache/go-build
109-
~/go/pkg/mod
110-
key: ${{ runner.os }}-go-${{ github.run_id }}
111-
restore-keys: ${{ runner.os }}-go
112-
113-
- name: Set up Docker Buildx
114-
uses: docker/setup-buildx-action@v1
115-
116-
- name: Cache Docker layers
117-
uses: actions/cache@v2
118-
with:
119-
path: /tmp/.buildx-cache
120-
key: ${{ runner.os }}-buildx-${{ github.sha }}
121-
restore-keys: |
122-
${{ runner.os }}-buildx-
123-
124-
- name: Calculate Docker metadata
125-
id: docker-meta
126-
uses: docker/metadata-action@v5
127-
with:
128-
images: |
129-
${{ env.PILOT_IMAGE_REGISTRY }}/${{ env.PILOT_IMAGE_NAME }}
130-
tags: |
131-
type=sha
132-
type=ref,event=tag
133-
type=semver,pattern={{version}}
134-
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
135-
136-
- name: Login to Docker Registry
137-
uses: docker/login-action@v3
138-
with:
139-
registry: ${{ env.PILOT_IMAGE_REGISTRY }}
140-
username: ${{ secrets.REGISTRY_USERNAME }}
141-
password: ${{ secrets.REGISTRY_PASSWORD }}
142-
143-
- name: Build Pilot-Discovery Image and Push
144-
run: |
145-
GOPROXY="https://proxy.golang.org,direct" make build-istio
146-
BUILT_IMAGE="higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/pilot"
147-
readarray -t IMAGES <<< "${{ steps.docker-meta.outputs.tags }}"
148-
for image in ${IMAGES[@]}; do
149-
echo "Image: $image"
150-
docker buildx imagetools create $BUILT_IMAGE:$GITHUB_SHA --tag $image
151-
done
152-
153-
154-
build-gateway-image:
155-
runs-on: ubuntu-latest
156-
environment:
157-
name: image-registry-pilot
158-
env:
159-
GATEWAY_IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }}
160-
GATEWAY_IMAGE_NAME: ${{ vars.GATEWAY_IMAGE_NAME || 'higress/gateway' }}
161-
steps:
162-
- name: "Checkout ${{ github.ref }}"
163-
uses: actions/checkout@v4
164-
with:
165-
fetch-depth: 1
166-
167-
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
168-
uses: jlumbroso/free-disk-space@main
169-
with:
170-
tool-cache: false
171-
android: true
172-
dotnet: true
173-
haskell: true
174-
large-packages: true
175-
swap-storage: true
176-
177-
- name: "Setup Go"
178-
uses: actions/setup-go@v5
179-
with:
180-
go-version: 1.21.5
181-
182-
- name: Setup Golang Caches
183-
uses: actions/cache@v4
184-
with:
185-
path: |-
186-
~/.cache/go-build
187-
~/go/pkg/mod
188-
key: ${{ runner.os }}-go-${{ github.run_id }}
189-
restore-keys: ${{ runner.os }}-go
190-
191-
- name: Set up Docker Buildx
192-
uses: docker/setup-buildx-action@v1
193-
194-
- name: Cache Docker layers
195-
uses: actions/cache@v2
196-
with:
197-
path: /tmp/.buildx-cache
198-
key: ${{ runner.os }}-buildx-${{ github.sha }}
199-
restore-keys: |
200-
${{ runner.os }}-buildx-
201-
202-
- name: Calculate Docker metadata
203-
id: docker-meta
204-
uses: docker/metadata-action@v5
205-
with:
206-
images: |
207-
${{ env.GATEWAY_IMAGE_REGISTRY }}/${{ env.GATEWAY_IMAGE_NAME }}
208-
tags: |
209-
type=sha
210-
type=ref,event=tag
211-
type=semver,pattern={{version}}
212-
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
213-
214-
- name: Login to Docker Registry
215-
uses: docker/login-action@v3
216-
with:
217-
registry: ${{ env.GATEWAY_IMAGE_REGISTRY }}
218-
username: ${{ secrets.REGISTRY_USERNAME }}
219-
password: ${{ secrets.REGISTRY_PASSWORD }}
220-
221-
- name: Build Gateway Image and Push
222-
run: |
223-
GOPROXY="https://proxy.golang.org,direct" make build-gateway
224-
BUILT_IMAGE="higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/proxyv2"
225-
readarray -t IMAGES <<< "${{ steps.docker-meta.outputs.tags }}"
226-
for image in ${IMAGES[@]}; do
227-
echo "Image: $image"
228-
docker buildx imagetools create $BUILT_IMAGE:$GITHUB_SHA --tag $image
229-
done
1+
name: Build Docker Images and Push to Image Registry
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
workflow_dispatch: ~
8+
9+
jobs:
10+
build-controller-image:
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: image-registry-controller
14+
env:
15+
CONTROLLER_IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }}
16+
CONTROLLER_IMAGE_NAME: ${{ vars.CONTROLLER_IMAGE_NAME || 'higress/higress' }}
17+
steps:
18+
- name: "Checkout ${{ github.ref }}"
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 1
22+
23+
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
24+
uses: jlumbroso/free-disk-space@main
25+
with:
26+
tool-cache: false
27+
android: true
28+
dotnet: true
29+
haskell: true
30+
large-packages: true
31+
swap-storage: true
32+
33+
- name: "Setup Go"
34+
uses: actions/setup-go@v5
35+
with:
36+
go-version: 1.21.5
37+
38+
- name: Setup Golang Caches
39+
uses: actions/cache@v4
40+
with:
41+
path: |-
42+
~/.cache/go-build
43+
~/go/pkg/mod
44+
key: ${{ runner.os }}-go-${{ github.run_id }}
45+
restore-keys: ${{ runner.os }}-go
46+
47+
- name: Calculate Docker metadata
48+
id: docker-meta
49+
uses: docker/metadata-action@v5
50+
with:
51+
images: |
52+
${{ env.CONTROLLER_IMAGE_REGISTRY }}/${{ env.CONTROLLER_IMAGE_NAME }}
53+
tags: |
54+
type=sha
55+
type=ref,event=tag
56+
type=semver,pattern={{version}}
57+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
58+
59+
- name: Login to Docker Registry
60+
uses: docker/login-action@v3
61+
with:
62+
registry: ${{ env.CONTROLLER_IMAGE_REGISTRY }}
63+
username: ${{ secrets.REGISTRY_USERNAME }}
64+
password: ${{ secrets.REGISTRY_PASSWORD }}
65+
66+
- name: Build Docker Image and Push
67+
run: |
68+
BUILT_IMAGE=""
69+
readarray -t IMAGES <<< "${{ steps.docker-meta.outputs.tags }}"
70+
for image in ${IMAGES[@]}; do
71+
echo "Image: $image"
72+
if [ "$BUILT_IMAGE" == "" ]; then
73+
GOPROXY="https://proxy.golang.org,direct" IMG_URL="$image" make docker-buildx-push
74+
BUILT_IMAGE="$image"
75+
else
76+
docker buildx imagetools create $BUILT_IMAGE --tag $image
77+
fi
78+
done
79+
80+
build-pilot-image:
81+
runs-on: ubuntu-latest
82+
environment:
83+
name: image-registry-pilot
84+
env:
85+
PILOT_IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }}
86+
PILOT_IMAGE_NAME: ${{ vars.PILOT_IMAGE_NAME || 'higress/pilot' }}
87+
steps:
88+
- name: "Checkout ${{ github.ref }}"
89+
uses: actions/checkout@v4
90+
with:
91+
fetch-depth: 1
92+
93+
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
94+
uses: jlumbroso/free-disk-space@main
95+
with:
96+
tool-cache: false
97+
android: true
98+
dotnet: true
99+
haskell: true
100+
large-packages: true
101+
swap-storage: true
102+
103+
- name: "Setup Go"
104+
uses: actions/setup-go@v5
105+
with:
106+
go-version: 1.21.5
107+
108+
- name: Setup Golang Caches
109+
uses: actions/cache@v4
110+
with:
111+
path: |-
112+
~/.cache/go-build
113+
~/go/pkg/mod
114+
key: ${{ runner.os }}-go-${{ github.run_id }}
115+
restore-keys: ${{ runner.os }}-go
116+
117+
- name: Set up QEMU
118+
uses: docker/setup-qemu-action@v3
119+
with:
120+
image: tonistiigi/binfmt:qemu-v7.0.0
121+
122+
- name: Set up Docker Buildx
123+
uses: docker/setup-buildx-action@v3
124+
125+
- name: Cache Docker layers
126+
uses: actions/cache@v2
127+
with:
128+
path: /tmp/.buildx-cache
129+
key: ${{ runner.os }}-buildx-${{ github.sha }}
130+
restore-keys: |
131+
${{ runner.os }}-buildx-
132+
133+
- name: Calculate Docker metadata
134+
id: docker-meta
135+
uses: docker/metadata-action@v5
136+
with:
137+
images: |
138+
${{ env.PILOT_IMAGE_REGISTRY }}/${{ env.PILOT_IMAGE_NAME }}
139+
tags: |
140+
type=sha
141+
type=ref,event=tag
142+
type=semver,pattern={{version}}
143+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
144+
145+
- name: Login to Docker Registry
146+
uses: docker/login-action@v3
147+
with:
148+
registry: ${{ env.PILOT_IMAGE_REGISTRY }}
149+
username: ${{ secrets.REGISTRY_USERNAME }}
150+
password: ${{ secrets.REGISTRY_PASSWORD }}
151+
152+
- name: Build Pilot-Discovery Image and Push
153+
run: |
154+
BUILT_IMAGE=""
155+
readarray -t IMAGES <<< "${{ steps.docker-meta.outputs.tags }}"
156+
for image in ${IMAGES[@]}; do
157+
echo "Image: $image"
158+
if [ "$BUILT_IMAGE" == "" ]; then
159+
TAG=${image#*:}
160+
HUB=${image%:*}
161+
HUB=${HUB%/*}
162+
BUILT_IMAGE="$HUB/pilot:$TAG"
163+
GOPROXY="https://proxy.golang.org,direct" IMG_URL="$BUILT_IMAGE" make build-istio
164+
fi
165+
if [ "$BUILT_IMAGE" != "$image" ]; then
166+
docker buildx imagetools create $BUILT_IMAGE --tag $image
167+
fi
168+
done
169+
170+
build-gateway-image:
171+
runs-on: ubuntu-latest
172+
environment:
173+
name: image-registry-gateway
174+
env:
175+
GATEWAY_IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }}
176+
GATEWAY_IMAGE_NAME: ${{ vars.GATEWAY_IMAGE_NAME || 'higress/gateway' }}
177+
steps:
178+
- name: "Checkout ${{ github.ref }}"
179+
uses: actions/checkout@v4
180+
with:
181+
fetch-depth: 1
182+
183+
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
184+
uses: jlumbroso/free-disk-space@main
185+
with:
186+
tool-cache: false
187+
android: true
188+
dotnet: true
189+
haskell: true
190+
large-packages: true
191+
swap-storage: true
192+
193+
- name: "Setup Go"
194+
uses: actions/setup-go@v5
195+
with:
196+
go-version: 1.21.5
197+
198+
- name: Setup Golang Caches
199+
uses: actions/cache@v4
200+
with:
201+
path: |-
202+
~/.cache/go-build
203+
~/go/pkg/mod
204+
key: ${{ runner.os }}-go-${{ github.run_id }}
205+
restore-keys: ${{ runner.os }}-go
206+
207+
- name: Set up QEMU
208+
uses: docker/setup-qemu-action@v3
209+
with:
210+
image: tonistiigi/binfmt:qemu-v7.0.0
211+
212+
- name: Set up Docker Buildx
213+
uses: docker/setup-buildx-action@v3
214+
215+
- name: Cache Docker layers
216+
uses: actions/cache@v2
217+
with:
218+
path: /tmp/.buildx-cache
219+
key: ${{ runner.os }}-buildx-${{ github.sha }}
220+
restore-keys: |
221+
${{ runner.os }}-buildx-
222+
223+
- name: Calculate Docker metadata
224+
id: docker-meta
225+
uses: docker/metadata-action@v5
226+
with:
227+
images: |
228+
${{ env.GATEWAY_IMAGE_REGISTRY }}/${{ env.GATEWAY_IMAGE_NAME }}
229+
tags: |
230+
type=sha
231+
type=ref,event=tag
232+
type=semver,pattern={{version}}
233+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
234+
235+
- name: Login to Docker Registry
236+
uses: docker/login-action@v3
237+
with:
238+
registry: ${{ env.GATEWAY_IMAGE_REGISTRY }}
239+
username: ${{ secrets.REGISTRY_USERNAME }}
240+
password: ${{ secrets.REGISTRY_PASSWORD }}
241+
242+
- name: Build Gateway Image and Push
243+
run: |
244+
BUILT_IMAGE=""
245+
readarray -t IMAGES <<< "${{ steps.docker-meta.outputs.tags }}"
246+
for image in ${IMAGES[@]}; do
247+
echo "Image: $image"
248+
if [ "$BUILT_IMAGE" == "" ]; then
249+
TAG=${image#*:}
250+
HUB=${image%:*}
251+
HUB=${HUB%/*}
252+
BUILT_IMAGE="$HUB/proxyv2:$TAG"
253+
GOPROXY="https://proxy.golang.org,direct" IMG_URL="$BUILT_IMAGE" make build-gateway
254+
fi
255+
if [ "$BUILT_IMAGE" != "$image" ]; then
256+
docker buildx imagetools create $BUILT_IMAGE --tag $image
257+
fi
258+
done

‎Makefile.core.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ buildx-prepare:
162162
build-gateway: prebuild buildx-prepare
163163
USE_REAL_USER=1 TARGET_ARCH=amd64 DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh init
164164
USE_REAL_USER=1 TARGET_ARCH=arm64 DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh init
165-
DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh docker.buildx
165+
DOCKER_TARGETS="docker.proxyv2" IMG_URL="${IMG_URL}" ./tools/hack/build-istio-image.sh docker.buildx
166166

167167
build-gateway-local: prebuild
168168
TARGET_ARCH=${TARGET_ARCH} DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh docker
169169

170170
build-istio: prebuild buildx-prepare
171-
DOCKER_TARGETS="docker.pilot" ./tools/hack/build-istio-image.sh docker.buildx
171+
DOCKER_TARGETS="docker.pilot" IMG_URL="${IMG_URL}" ./tools/hack/build-istio-image.sh docker.buildx
172172

173173
build-istio-local: prebuild
174174
TARGET_ARCH=${TARGET_ARCH} DOCKER_TARGETS="docker.pilot" ./tools/hack/build-istio-image.sh docker

‎docker/docker.mk

+4-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ DOCKER_ALL_VARIANTS ?= debug distroless
3535
INCLUDE_UNTAGGED_DEFAULT ?= false
3636
DEFAULT_DISTRIBUTION=debug
3737

38-
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 ); )
39-
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 . ); )
38+
IMG ?= higress
39+
IMG_URL ?= $(HUB)/$(IMG):$(TAG)
4040

41+
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 ); )
42+
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 . ); )

‎tools/hack/build-envoy.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ fi
3030
CONDITIONAL_HOST_MOUNTS+="--mount type=bind,source=${ROOT}/external/package,destination=/home/package "
3131
CONDITIONAL_HOST_MOUNTS+="--mount type=bind,source=${ROOT}/external/envoy,destination=/home/envoy "
3232

33+
BUILD_TOOLS_IMG=${BUILD_TOOLS_IMG:-"higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/build-tools:release-1.19-ef344298e65eeb2d9e2d07b87eb4e715c2def613"}
34+
3335
BUILD_WITH_CONTAINER=1 \
3436
CONDITIONAL_HOST_MOUNTS=${CONDITIONAL_HOST_MOUNTS} \
3537
BUILD_ENVOY_BINARY_ONLY=1 \
3638
DOCKER_RUN_OPTIONS="--user root -e HTTP_PROXY -e HTTPS_PROXY" \
37-
IMG=higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/build-tools-proxy:release-1.19-ef344298e65eeb2d9e2d07b87eb4e715c2def613 \
39+
IMG=${BUILD_TOOLS_IMG} \
3840
make test_release

‎tools/hack/build-istio-image.sh

+22-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,34 @@ CONDITIONAL_HOST_MOUNTS+="--mount type=bind,source=${ROOT}/external/package,dest
2525

2626
DOCKER_RUN_OPTIONS+="-e HTTP_PROXY -e HTTPS_PROXY"
2727

28+
BUILD_TOOLS_IMG=${BUILD_TOOLS_IMG:-"higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/build-tools:release-1.19-ef344298e65eeb2d9e2d07b87eb4e715c2def613"}
29+
30+
ORIGINAL_HUB=${HUB}
31+
32+
echo "IMG_URL=$IMG_URL"
33+
34+
if [ -n "$IMG_URL" ]; then
35+
TAG=${IMG_URL#*:}
36+
HUB=${IMG_URL%:*}
37+
HUB=${HUB%/*}
38+
if [ "$TAG" == "${IMG_URL}" ]; then
39+
TAG=latest
40+
fi
41+
fi
42+
43+
echo "HUB=$HUB"
44+
echo "TAG=$TAG"
45+
2846
GOOS_LOCAL=linux TARGET_OS=linux TARGET_ARCH=${TARGET_ARCH} \
2947
ISTIO_ENVOY_LINUX_RELEASE_URL=${ISTIO_ENVOY_LINUX_RELEASE_URL} \
3048
BUILD_WITH_CONTAINER=1 \
3149
USE_REAL_USER=${USE_REAL_USER:-0} \
3250
CONDITIONAL_HOST_MOUNTS=${CONDITIONAL_HOST_MOUNTS} \
3351
DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="${DOCKER_TARGETS}" \
34-
ISTIO_BASE_REGISTRY="${HUB}" \
52+
ISTIO_BASE_REGISTRY="${ORIGINAL_HUB}" \
3553
BASE_VERSION="${HIGRESS_BASE_VERSION}" \
3654
DOCKER_RUN_OPTIONS=${DOCKER_RUN_OPTIONS} \
37-
IMG=higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/build-tools:release-1.19-ef344298e65eeb2d9e2d07b87eb4e715c2def613 \
55+
HUB="${HUB}" \
56+
TAG="${TAG}" \
57+
IMG=${BUILD_TOOLS_IMG} \
3858
make "$@"

‎tools/hack/build-istio-pilot.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ set -euo pipefail
1919
source "$(dirname -- "$0")/setup-istio-env.sh"
2020

2121
cd ${ROOT}/external/istio
22-
rm -rf out/linux_${TARGET_ARCH};
22+
rm -rf out/linux_${TARGET_ARCH};
23+
24+
BUILD_TOOLS_IMG=${BUILD_TOOLS_IMG:-"higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/build-tools:release-1.19-ef344298e65eeb2d9e2d07b87eb4e715c2def613"}
2325

2426
GOOS_LOCAL=linux TARGET_OS=linux TARGET_ARCH=${TARGET_ARCH} \
2527
ISTIO_ENVOY_LINUX_RELEASE_URL=${ISTIO_ENVOY_LINUX_RELEASE_URL} \
@@ -28,5 +30,5 @@ GOOS_LOCAL=linux TARGET_OS=linux TARGET_ARCH=${TARGET_ARCH} \
2830
ISTIO_BASE_REGISTRY="${HUB}" \
2931
BASE_VERSION="${HIGRESS_BASE_VERSION}" \
3032
DOCKER_RUN_OPTIONS="--user root -e HTTP_PROXY -e HTTPS_PROXY" \
31-
IMG=higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/build-tools:release-1.19-ef344298e65eeb2d9e2d07b87eb4e715c2def613 \
33+
IMG=${BUILD_TOOLS_IMG} \
3234
make build-linux

0 commit comments

Comments
 (0)
Please sign in to comment.