Skip to content

拉取镜像到本地 #43

拉取镜像到本地

拉取镜像到本地 #43

Workflow file for this run

name: 拉取镜像到本地
on:
workflow_dispatch:
inputs:
oldimage_name:
description: '镜像地址'
default: 'nginx busybox alpine'
cpu_arch:
description: '默认x86'
default: 'amd64'
type: choice
options:
- amd64
- arm64
- arm/v6
- arm/v7
- 386
- s390
- ppc64le
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: 拉取镜像并下载到本地
run: |
cpu_arch=${{ github.event.inputs.cpu_arch }}
echo ${cpu_arch}
for i in ${{ github.event.inputs.oldimage_name }}
do
docker pull $i --platform=${cpu_arch}
name=`echo $i | awk -F ':' '{print $1}'|awk -F '/' '{print $NF}'`
docker save $i -o $name.tar
done
mkdir artifacts
mv *.tar artifacts/
- uses: actions/upload-artifact@v2
#- uses: actions/upload-artifact@v3
with:
name: artifacts
path: artifacts/*