Skip to content

crazy-max/ghaction-dockerhub-mirror

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub release CI workflow Become a sponsor Paypal Donate

About

GitHub Action composite to mirror a DockerHub repo to another registry.

Screenshot


Usage

name: dockerhub-mirror

on:
  workflow_dispatch:
    inputs:
      dockerhub-repo:
        description: 'DockerHub repository'
        required: true
      dest-registry:
        description: 'Destination registry (eg. ghcr.io)'
        required: true
      dest-repo:
        description: 'Destination repository (eg. username/repo)'
        required: true
      dry-run:
        description: 'Dry run'
        required: false
        default: 'false'

jobs:
  dockerhub-mirror:
    runs-on: ubuntu-latest
    steps:
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v2
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      -
        name: Login to DockerHub
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      -
        name: Login to ${{ github.event.inputs.dest-registry }}
        uses: docker/login-action@v2
        with:
          registry: ${{ github.event.inputs.dest-registry }}
          username: ${{ secrets.DEST_USERNAME }}
          password: ${{ secrets.DEST_PASSWORD }}
      -
        name: Mirror ${{ github.event.inputs.dockerhub-repo }} to ${{ github.event.inputs.dest-registry }}/${{ github.event.inputs.dest-repo }}
        uses: crazy-max/ghaction-dockerhub-mirror@v1
        with:
          dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
          dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN }}
          dockerhub-repo: ${{ github.event.inputs.dockerhub-repo }}
          dest-registry: ${{ github.event.inputs.dest-registry }}
          dest-repo: ${{ github.event.inputs.dest-repo }}
          dry-run: ${{ github.event.inputs.dry-run }}

Customizing

inputs

See action.yml

Contributing

Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. If you want to open a pull request, please read the contributing guidelines.

You can also support this project by becoming a sponsor on GitHub or by making a Paypal donation to ensure this journey continues indefinitely!

Thanks again for your support, it is much appreciated! 🙏

License

MIT. See LICENSE for more details.