Skip to content

Commit 406dd2b

Browse files
committed
test: docker manifest 4
1 parent de516b2 commit 406dd2b

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

.github/workflows/docker-image.yml

+11-12
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ jobs:
3939
username: ${{ github.actor }} # 使用当前 GitHub 用户名
4040
password: ${{ secrets.CR_TOKEN }} # 使用您刚刚添加的个人访问令牌
4141

42-
- name: Check disk space
43-
run: df -h
44-
4542
# - name: docker image
4643
# run: |
4744
# docker images
@@ -73,28 +70,28 @@ jobs:
7370

7471
- name: Build and push with retry for amd64
7572
run: |
76-
max_retries=3
73+
max_retries=5
7774
count=0
7875
success=false
7976
8077
while [[ $count -lt $max_retries ]]; do
8178
echo "Attempt $(($count + 1)) of $max_retries..."
82-
docker buildx build --push \
79+
docker build --push \
8380
--platform linux/amd64 \
8481
--tag ${{ matrix.image.tag }}-amd64 \
8582
-f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break
8683
8784
count=$(($count + 1))
8885
echo "Build failed, retrying in 5 seconds..."
89-
sleep 5
86+
sleep 15
9087
done
9188
9289
if [ "$success" = false ]; then
9390
echo "Build failed after $max_retries attempts."
9491
exit 1
9592
fi
9693
97-
- name: docker image
94+
- name: docker image for amd64
9895
run: |
9996
df -h
10097
docker images
@@ -110,35 +107,37 @@ jobs:
110107

111108
- name: Build and push with retry for arm64
112109
run: |
113-
max_retries=3
110+
max_retries=5
114111
count=0
115112
success=false
116113
117114
while [[ $count -lt $max_retries ]]; do
118115
echo "Attempt $(($count + 1)) of $max_retries..."
119-
docker buildx build --push \
116+
docker build --push \
120117
--platform linux/arm64 \
121118
--tag ${{ matrix.image.tag }}-arm64 \
122119
-f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break
123120
124121
count=$(($count + 1))
125122
echo "Build failed, retrying in 5 seconds..."
126-
sleep 5
123+
sleep 15
127124
done
128125
129126
if [ "$success" = false ]; then
130127
echo "Build failed after $max_retries attempts."
131128
exit 1
132129
fi
133130
134-
- name: docker image
131+
- name: docker image for arm64
135132
run: |
136133
df -h
137134
docker images
138135
139-
- name: docker image
136+
- name: docker manifest
140137
run: |
141138
docker images
139+
docker manifest inspect ${{ matrix.image.tag }}-arm64
140+
docker manifest inspect ${{ matrix.image.tag }}-amd64
142141
docker manifest create ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64
143142
docker manifest inspect ${{ matrix.image.tag }}
144143
docker manifest push ${{ matrix.image.tag }}

0 commit comments

Comments
 (0)