Skip to content

Commit

Permalink
迁移固定版本镜像
Browse files Browse the repository at this point in the history
  • Loading branch information
llody55 committed Jun 12, 2024
1 parent 5f123b7 commit fff08cd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 111 deletions.
132 changes: 24 additions & 108 deletions images-to-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,134 +52,50 @@ images:
- tag: 5.0
rabbitmq:
- tag: latest
- tag: 3.13.3-management
- tag: 3.13.3
- tag: 3.9.9-management
- tag: 3.9.9
- tag: 3.8.26-management
- tag: 3.8.26
mongo:
- tag: latest
- tag: 6.0.5
- tag: 7.0.9
- tag: 7.0
- tag: 6
- tag: 6.0
- tag: 6
- tag: 5.0
- tag: 5
golang:
- tag: latest
- tag: 1.19.1
- tag: 1.19
- tag: 1.18.15
- tag: 1.18
- tag: 1.17.15
- tag: 1.17
- tag: 1.16.15
- tag: 1.16
- tag: 1.15.15
- tag: 1.15
- tag: 1.22.4
- tag: 1.21.4
- tag: 1.20.4
- tag: 1.19.4
portainer/portainer-ce:
- tag: latest
- tag: 2.20.3
elasticsearch:
- tag: 8.4.3
- tag: 8.4.2
- tag: 8.4.1
- tag: 8.4
- tag: 8.3.3
- tag: 8.3.2
- tag: 8.3.1
- tag: 8.3
- tag: 8.2.3
- tag: 8.2.2
- tag: 8.2.1
- tag: 8.2
- tag: 8.1.3
- tag: 8.1.2
- tag: 8.1.1
- tag: 8.1
- tag: 8.0.2
- tag: 8.0.1
- tag: 8.0
- tag: 7.17.21
- tag: 7.17.19
- tag: 7.17.17
- tag: 8.9.2
- tag: 7.9.3
- tag: 7.17.14
- tag: 7.17.4
kibana:
- tag: 8.4.3
- tag: 8.4.2
- tag: 8.4.1
- tag: 8.4
- tag: 8.3.3
- tag: 8.3.2
- tag: 8.3.1
- tag: 8.3
- tag: 8.2.3
- tag: 8.2.2
- tag: 8.2.1
- tag: 8.2
- tag: 8.1.3
- tag: 8.1.2
- tag: 8.1.1
- tag: 8.1
- tag: 8.0.2
- tag: 8.0.1
- tag: 8.0
- tag: 7.17.21
- tag: 7.17.19
- tag: 7.17.17
- tag: 8.9.2
- tag: 7.9.3
- tag: 7.17.14
- tag: 7.17.4
logstash:
- tag: 8.4.3
- tag: 8.4.2
- tag: 8.4.1
- tag: 8.4
- tag: 8.3.3
- tag: 8.3.2
- tag: 8.3.1
- tag: 8.3
- tag: 8.2.3
- tag: 8.2.2
- tag: 8.2.1
- tag: 8.2
- tag: 8.1.3
- tag: 8.1.2
- tag: 8.1.1
- tag: 8.1
- tag: 8.0.2
- tag: 8.0.1
- tag: 8.0
- tag: 7.17.21
- tag: 7.17.19
- tag: 7.17.17
- tag: 8.9.2
- tag: 7.9.3
- tag: 7.17.14
- tag: 7.17.4
fluentd:
- tag: 2.1.1
- tag: 2.1.0
- tag: 2.0.1
- tag: 2.0.0
fluent-bit:
- tag: 1.9.1
- tag: 1.9.0
- tag: 1.8.12
- tag: 1.8.11
- tag: 1.8.10
- tag: 1.8.9
- tag: 1.8.8
- tag: 1.8.7
- tag: 1.8.6
- tag: 1.8.5
- tag: 1.8.4
- tag: 1.8.3
- tag: 1.8.2
- tag: 1.8.1
- tag: 1.8.0
- tag: 1.7.10
- tag: 1.7.9
- tag: 1.7.8
- tag: 1.7.7
- tag: 1.7.6
- tag: 1.7.5
- tag: 1.7.4
- tag: 1.7.3
- tag: 1.7.2
- tag: 1.7.1
- tag: 1.7.0
- tag: 1.6.12
- tag: 1.6.11
fluent/fluent-bit:
- tag: 3.0.7
- tag: 2.2.1
- tag: 1.9.9

10 changes: 7 additions & 3 deletions sync_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Author: llody [email protected]
Date: 2024-06-11 18:07:57
LastEditors: llody [email protected]
LastEditTime: 2024-06-12 11:21:12
LastEditTime: 2024-06-12 11:35:36
FilePath: \sync-images\.github\workflows\app\sync_images.py
Description: 批量镜像同步脚本
'''
Expand All @@ -27,9 +27,11 @@
# 提取组织名称和镜像名称
if '/' in image_name:
org_name, repo_name = image_name.split('/')
print("完整组织名称和镜像名称:", org_name, repo_name)
else:
org_name = namespace
repo_name = image_name
print("拼接组织名称和镜像名称:", org_name, repo_name)

for tag_info in tags:
tag = tag_info["tag"]
Expand All @@ -46,14 +48,16 @@

try:
print(f"Syncing {source_image} to {aliyun_target_image}")
subprocess.run(["skopeo", "copy", "--all", source_image, aliyun_target_image], check=True)
subprocess.run(["skopeo", "copy", "--all", "--format", "v2s2", source_image, aliyun_target_image], check=True)
except subprocess.CalledProcessError as e:
print(f"Error syncing {source_image} to {aliyun_target_image}: {e}")
print(f"Output: {e.output}")
continue

try:
print(f"Syncing {source_image} to {huawei_target_image}")
subprocess.run(["skopeo", "copy", "--all", source_image, huawei_target_image], check=True)
subprocess.run(["skopeo", "copy", "--all", "--format", "v2s2", source_image, huawei_target_image], check=True)
except subprocess.CalledProcessError as e:
print(f"Error syncing {source_image} to {huawei_target_image}: {e}")
print(f"Output: {e.output}")
continue

0 comments on commit fff08cd

Please sign in to comment.