Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xin053/mirror_docker_image
mirror docker images from registries such as `gcr.io` to `docker.io`
https://github.com/xin053/mirror_docker_image
docker mirror registry
Last synced: about 1 month ago
JSON representation
mirror docker images from registries such as `gcr.io` to `docker.io`
- Host: GitHub
- URL: https://github.com/xin053/mirror_docker_image
- Owner: xin053
- License: mit
- Created: 2021-11-11T04:32:40.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-29T03:07:50.000Z (about 3 years ago)
- Last Synced: 2023-03-02T16:11:22.021Z (almost 2 years ago)
- Topics: docker, mirror, registry
- Homepage: https://hub.docker.com/u/xin053
- Size: 71.3 KB
- Stars: 5
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mirror_docker_image
![github action](https://github.com/xin053/mirror_docker_image/actions/workflows/mirror_docker_image.yml/badge.svg)
[github](https://github.com/xin053/mirror_docker_image)
[中文文档](https://github.com/xin053/mirror_docker_image/blob/main/README_zh.md)
Synchronize the `docker` image from one registry to another through `github action`. For example, synchronize the specified docker image under `gcr.io` to `docker.io`.
## Usage
Open a new `issue`, then use the image name to be synchronized as title (**The image name needs to be a full name, which means `registry` and `tag` cannot be omitted**), the content of `issue` can be empty.
For example: open a new `issue` with title `k8s.gcr.io/kube-state-metrics/kube-state-metrics:latest`, Then the github action will automatically pull the image and push it to the [`xin053` repository](https://hub.docker.com/u/xin053), then you can use `docker pull xin053/kube-state-metrics:latest` command to pull the image.
You can view the synchronized docker images through the link below:
[https://hub.docker.com/u/xin053](https://hub.docker.com/u/xin053)
![](https://github.com/xin053/mirror_docker_image/blob/main/images/1.png)
## Customize ` action`
After `fork` this repository, check `issues` in `features` on the `Settings` page of the forked repository, then enable `GitHub actions` on the `Actions` page, add corresponding `secrets` as needed, then you can create `issue` in your forked repository to synchronize the docker image
## `secrets` supported by `action`
| key | value |
| :-----------------: | :----------------------------------: |
| `SOURCE_USERNAME` | username of source registry |
| `SOURCE_PASSWORD` | password of source registry |
| `TARGET_REGISTRY` | target registry, default `docker.io` |
| `TARGET_REPOSITORY` | target repository, default null |
| `TARGET_USERNAME` | username of `docker hub` |
| `TARGET_PASSWORD` | password or `token` of `docker hub` |## If the source registry needs to log in
After `fork` this github repository, add the following `secrets`:
| key | value |
| :---------------: | :---------------------------------: |
| `SOURCE_USERNAME` | username of source registry |
| `SOURCE_PASSWORD` | password of source registry |
| `TARGET_USERNAME` | username of `docker hub` |
| `TARGET_PASSWORD` | password or `token` of `docker hub` |**Remarks: If you log in with token on docker hub, you cannot modify the description of the synchronized docker images**
For details: [https://github.com/peter-evans/dockerhub-description/issues/10](https://github.com/peter-evans/dockerhub-description/issues/10)
## If the target registry is not `docker.io`
After `fork` this github repository, add the following `secrets`:
| key | value |
| :-----------------: | :--------------------------------: |
| `TARGET_REGISTRY` | target registry, such as `ghcr.io` |
| `TARGET_REPOSITORY` | target repository, such as `test` |
| `TARGET_USERNAME` | username of target registry |
| `TARGET_PASSWORD` | password of target registry |## Project stats
![Alt](https://repobeats.axiom.co/api/embed/11e8bb6f504f02fca58a38db2527c314b8a0b9c4.svg "Repobeats analytics image")