Giter VIP home page Giter VIP logo

skopeo-copy-action's Introduction

Skopeo Copy Action

Reference: Copying images

Copy image from src to dst.

Inputs

Input parameter name Description Example
src-image source image with tag to copy from coseus.azurecr.io/platform:latest
src-creds credentials with format: [USERNAME]:[PASSWORD] to pull source image username:password
dst-image destination image with tag to copy to registry.cn-hangzhou.aliyuncs.com/coscene/platform:latest
dst-creds credentials with format: [USERNAME]:[PASSWORD] to push destination image username:password

Troubleshooting

  1. You MUST ensure that the content of the credentials [USERNAME]:[PASSWORD] DOES NOT contain any colons(:) other than the separator one. Otherwise, it is likely that the registry will not be accessed correctly. Of course, we can extend the cred parameters to registry, username and password to avoid this problem. But this increases the complexity of this action.
  2. We tend to use Skopeo inside GFW to sync the outside image into the registry inside GFW. When you run this action on self-hosted runner, you MUST ensure that Skopeo installed. Here is an example to use an action-runner-dind with Skopeo.
# You can mirror actions-runner-dind:ubuntu-22.04 first by the following cmd:
# skopeo copy --dest-creds <creds> \ 
# docker://ghcr.io/actions-runner-controller/actions-runner-controller/actions-runner-dind@sha256:cdbd5684259efe90b0d88e656ef2a154f34ce7b1104d892ca6061d96055bc94b \
# docker://registry.cn-hangzhou.aliyuncs.com/coscene/actions-runner-dind:ubuntu-22.04 
FROM registry.cn-hangzhou.aliyuncs.com/coscene/actions-runner-dind:ubuntu-22.04

RUN sudo apt-get update -y \
    && sudo apt-get install -y skopeo

A little best practice

Here is a typical example about maintaining images between the registry outside GFW and the one inside GFW.

We build docker image on GitHub-hosted runner and sync image from the registry outside the GFW to the registry inside GFW on self-hosted runner. If the synchronization fails on self-hosted runner, the job will be done on GitHub-hosted runner as a fallback. This has proven to be the most economically efficient (cost of self-built containers) and time-consuming overall. Practice has shown that it is more difficult and insurmountable to push and pull data from outside the GFW to inside the GFW than to push and pull data from inside the GFW through a reliable network proxy.

skopeo-copy-action's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.