Skip to content

Mirror Dockerhub

Mirror Dockerhub #119

Workflow file for this run

name: Mirror Dockerhub
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
push:
branches:
- master
jobs:
mirror:
name: Mirror
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- image: alpine
repo: docker.io
- image: busybox
repo: docker.io
- image: curl
repo: docker.io/curlimages
- image: debian
repo: docker.io
- image: docker
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
- image: ubuntu
repo: docker.io
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- uses: actions/setup-go@v5
- 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