Skip to content

Commit

Permalink
test: docker manifest 4
Browse files Browse the repository at this point in the history
  • Loading branch information
lightislost committed Nov 12, 2024
1 parent de516b2 commit 406dd2b
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ jobs:
username: ${{ github.actor }} # 使用当前 GitHub 用户名
password: ${{ secrets.CR_TOKEN }} # 使用您刚刚添加的个人访问令牌

- name: Check disk space
run: df -h

# - name: docker image
# run: |
# docker images
Expand Down Expand Up @@ -73,28 +70,28 @@ jobs:

- name: Build and push with retry for amd64
run: |
max_retries=3
max_retries=5
count=0
success=false
while [[ $count -lt $max_retries ]]; do
echo "Attempt $(($count + 1)) of $max_retries..."
docker buildx build --push \
docker build --push \
--platform linux/amd64 \
--tag ${{ matrix.image.tag }}-amd64 \
-f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break
count=$(($count + 1))
echo "Build failed, retrying in 5 seconds..."
sleep 5
sleep 15
done
if [ "$success" = false ]; then
echo "Build failed after $max_retries attempts."
exit 1
fi
- name: docker image
- name: docker image for amd64
run: |
df -h
docker images
Expand All @@ -110,35 +107,37 @@ jobs:

- name: Build and push with retry for arm64
run: |
max_retries=3
max_retries=5
count=0
success=false
while [[ $count -lt $max_retries ]]; do
echo "Attempt $(($count + 1)) of $max_retries..."
docker buildx build --push \
docker build --push \
--platform linux/arm64 \
--tag ${{ matrix.image.tag }}-arm64 \
-f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break
count=$(($count + 1))
echo "Build failed, retrying in 5 seconds..."
sleep 5
sleep 15
done
if [ "$success" = false ]; then
echo "Build failed after $max_retries attempts."
exit 1
fi
- name: docker image
- name: docker image for arm64
run: |
df -h
docker images
- name: docker image
- name: docker manifest
run: |
docker images
docker manifest inspect ${{ matrix.image.tag }}-arm64
docker manifest inspect ${{ matrix.image.tag }}-amd64
docker manifest create ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64
docker manifest inspect ${{ matrix.image.tag }}
docker manifest push ${{ matrix.image.tag }}
Expand Down

0 comments on commit 406dd2b

Please sign in to comment.