Skip to content

Mirror Dockerhub

Mirror Dockerhub #1150

Workflow file for this run

name: Mirror Dockerhub
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
mirror:
name: Mirror
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: alpine
repo: docker.io
- image: busybox
repo: docker.io
- image: debian
repo: docker.io
- image: golang
repo: docker.io
- image: mysql
repo: docker.io
- image: node
repo: docker.io
- image: openjdk
repo: docker.io
- image: postgres
repo: docker.io
- image: python
repo: docker.io
- image: rust
repo: docker.io
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- uses: actions/setup-go@v4
- uses: imjasonh/[email protected]
- name: Mirror
run: |
for tag in $(cat ./images/${{ matrix.image }}); do
crane copy \
${{ matrix.repo }}/${{ matrix.image }}:$tag \
ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:$tag
done