添加多架构支持

This commit is contained in:
tech-shrimp 2024-06-09 18:47:28 +08:00
parent a2d26be1dc
commit bf1594f39e
4 changed files with 17 additions and 7 deletions

View File

@ -27,12 +27,17 @@ jobs:
- name: Build and push image Aliyun - name: Build and push image Aliyun
run: | run: |
docker login -u $ALIYUN_REGISTRY_USER -p $ALIYUN_REGISTRY_PASSWORD $ALIYUN_REGISTRY 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 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" new_image="$ALIYUN_REGISTRY/$ALIYUN_NAME_SPACE/$image_name_tag"
echo "docker tag $image $new_image" echo "docker tag $image $new_image"
docker tag $line $new_image docker tag $image $new_image
echo "docker push $new_image" echo "docker push $new_image"
docker push $new_image docker push $new_image
done done < images.txt

View File

@ -33,8 +33,11 @@ Fork本项目<br>
的值配置成环境变量 的值配置成环境变量
### 添加镜像 ### 添加镜像
打开images.txt文件添加你想要的镜像可以带tag也可以不用默认latest 打开images.txt文件添加你想要的镜像可以带tag也可以不用(默认latest)<br>
文件提交后自动进入Github Action构建 也可添加--platform xxxxx参数指定镜像架构<br>
![](doc/images.png)
文件提交后自动进入Github Action构建
### 使用镜像 ### 使用镜像
回到阿里云,镜像仓库,点击任意镜像,可查看镜像状态。(可以改成公开,拉取镜像免登录) 回到阿里云,镜像仓库,点击任意镜像,可查看镜像状态。(可以改成公开,拉取镜像免登录)

BIN
doc/images.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -1,3 +1,5 @@
alpine alpine
kasmweb/nginx:1.25.3
python:alpine3.19 python:alpine3.19
kasmweb/nginx:1.25.3
--platform linux/arm64 cooderl/wewe-rss-sqlite:latest