39
39
username : ${{ github.actor }} # 使用当前 GitHub 用户名
40
40
password : ${{ secrets.CR_TOKEN }} # 使用您刚刚添加的个人访问令牌
41
41
42
- - name : Check disk space
43
- run : df -h
44
-
45
42
# - name: docker image
46
43
# run: |
47
44
# docker images
@@ -73,28 +70,28 @@ jobs:
73
70
74
71
- name : Build and push with retry for amd64
75
72
run : |
76
- max_retries=3
73
+ max_retries=5
77
74
count=0
78
75
success=false
79
76
80
77
while [[ $count -lt $max_retries ]]; do
81
78
echo "Attempt $(($count + 1)) of $max_retries..."
82
- docker buildx build --push \
79
+ docker build --push \
83
80
--platform linux/amd64 \
84
81
--tag ${{ matrix.image.tag }}-amd64 \
85
82
-f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break
86
83
87
84
count=$(($count + 1))
88
85
echo "Build failed, retrying in 5 seconds..."
89
- sleep 5
86
+ sleep 15
90
87
done
91
88
92
89
if [ "$success" = false ]; then
93
90
echo "Build failed after $max_retries attempts."
94
91
exit 1
95
92
fi
96
93
97
- - name : docker image
94
+ - name : docker image for amd64
98
95
run : |
99
96
df -h
100
97
docker images
@@ -110,35 +107,37 @@ jobs:
110
107
111
108
- name : Build and push with retry for arm64
112
109
run : |
113
- max_retries=3
110
+ max_retries=5
114
111
count=0
115
112
success=false
116
113
117
114
while [[ $count -lt $max_retries ]]; do
118
115
echo "Attempt $(($count + 1)) of $max_retries..."
119
- docker buildx build --push \
116
+ docker build --push \
120
117
--platform linux/arm64 \
121
118
--tag ${{ matrix.image.tag }}-arm64 \
122
119
-f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break
123
120
124
121
count=$(($count + 1))
125
122
echo "Build failed, retrying in 5 seconds..."
126
- sleep 5
123
+ sleep 15
127
124
done
128
125
129
126
if [ "$success" = false ]; then
130
127
echo "Build failed after $max_retries attempts."
131
128
exit 1
132
129
fi
133
130
134
- - name : docker image
131
+ - name : docker image for arm64
135
132
run : |
136
133
df -h
137
134
docker images
138
135
139
- - name : docker image
136
+ - name : docker manifest
140
137
run : |
141
138
docker images
139
+ docker manifest inspect ${{ matrix.image.tag }}-arm64
140
+ docker manifest inspect ${{ matrix.image.tag }}-amd64
142
141
docker manifest create ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64
143
142
docker manifest inspect ${{ matrix.image.tag }}
144
143
docker manifest push ${{ matrix.image.tag }}
0 commit comments