Skip to content

Commit

Permalink
添加多架构支持
Browse files Browse the repository at this point in the history
  • Loading branch information
tech-shrimp committed Jun 9, 2024
1 parent a2d26be commit bf1594f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ jobs:
- name: Build and push image Aliyun
run: |
docker login -u $ALIYUN_REGISTRY_USER -p $ALIYUN_REGISTRY_PASSWORD $ALIYUN_REGISTRY
for line in $(cat images.txt); do
while IFS= read -r line; do
[[ -z "$line" ]] && continue
echo "docker pull $line"
docker pull $line
image_name_tag=$(echo $line | awk -F'/' '{print $NF}')
# 获取镜像的完整名称,例如kasmweb/nginx:1.25.3(命名空间/镜像名:版本号)
image=$(echo "$line" | awk '{print $NF}')
# 获取 镜像名:版本号 例如nginx:1.25.3
image_name_tag=$(echo "$image" | awk -F'/' '{print $NF}')
new_image="$ALIYUN_REGISTRY/$ALIYUN_NAME_SPACE/$image_name_tag"
echo "docker tag $image $new_image"
docker tag $line $new_image
docker tag $image $new_image
echo "docker push $new_image"
docker push $new_image
done
done < images.txt
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ Fork本项目<br>
的值配置成环境变量

### 添加镜像
打开images.txt文件,添加你想要的镜像,可以带tag,也可以不用(默认latest)
文件提交后自动进入Github Action构建
打开images.txt文件,添加你想要的镜像,可以带tag,也可以不用(默认latest)<br>
也可添加--platform xxxxx参数指定镜像架构<br>
![](doc/images.png)
文件提交后,自动进入Github Action构建


### 使用镜像
回到阿里云,镜像仓库,点击任意镜像,可查看镜像状态。(可以改成公开,拉取镜像免登录)
Expand Down
Binary file added doc/images.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion images.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
alpine
kasmweb/nginx:1.25.3
python:alpine3.19
kasmweb/nginx:1.25.3
--platform linux/arm64 cooderl/wewe-rss-sqlite:latest

0 comments on commit bf1594f

Please sign in to comment.