File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,24 @@ jobs:
30
30
env :
31
31
QYWX_ROBOT_URL : ${{ secrets.QYWX_ROBOT_URL }}
32
32
steps :
33
+ - name : Set up Docker Buildx
34
+ uses : docker/setup-buildx-action@v3
35
+
33
36
- name : Login to Docker Registry
34
37
run : docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} ${{ github.event.inputs.TARGET_REGISTRY }}
35
38
36
- - name : Pull, tag, and push Docker image
39
+ - name : Pull and push all platform images
37
40
run : |
38
- docker pull ${{ github.event.inputs.IMAGE_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
39
- docker tag ${{ github.event.inputs.IMAGE_NAME }}:${{ github.event.inputs.IMAGE_VERSION }} ${{ github.event.inputs.TARGET_REGISTRY }}/${{ github.event.inputs.TARGET_REPOSITORY }}/${{ github.event.inputs.NEW_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
40
- docker push ${{ github.event.inputs.TARGET_REGISTRY }}/${{ github.event.inputs.TARGET_REPOSITORY }}/${{ github.event.inputs.NEW_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
41
+ # 创建一个新的 builder 实例
42
+ docker buildx create --use
43
+
44
+ # 拉取源镜像的 manifest list
45
+ docker buildx imagetools inspect ${{ github.event.inputs.IMAGE_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
46
+
47
+ # 使用 buildx 拉取并推送所有架构的镜像
48
+ docker buildx imagetools create \
49
+ --tag ${{ github.event.inputs.TARGET_REGISTRY }}/${{ github.event.inputs.TARGET_REPOSITORY }}/${{ github.event.inputs.NEW_NAME }}:${{ github.event.inputs.IMAGE_VERSION }} \
50
+ ${{ github.event.inputs.IMAGE_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
41
51
42
52
- name : qyweixin send message
43
53
if : ${{ env.QYWX_ROBOT_URL != '' }}
48
58
with :
49
59
msgtype : markdown
50
60
content : |
51
- # 镜像同步成功
61
+ # 镜像同步成功(多架构)
52
62
```
53
63
${{ env.IMAGE_URL }}
64
+
65
+ 支持的架构:
66
+ $(docker buildx imagetools inspect ${{ env.IMAGE_URL }} | grep -A 5 "Platform:")
54
67
```
You can’t perform that action at this time.
0 commit comments