-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docker mirrors support #653
Comments
Hi, Can you elaborate on why we should implement this?
These are honest questions by the way, I am mostly curious to know how having mirrors could benefit the different actions. I suppose that this feature would probably have to reach the different other related github actions too. Possible Implementation detailsIn the case where someone would be interested in implementing this, my understanding is that we would have to update these files: class Input {
// ... existing code ...
static get dockerRegistryMirrors(): string[] {
const input = Input.getInput('dockerRegistryMirrors');
if (!input) {
return [];
}
try {
return yaml.load(input) as string[];
} catch (e) {
core.error(`Failed to parse dockerRegistryMirrors input: ${e}`);
return [];
}
}
// ... existing code ...
} Somewhere in here: unity-builder/src/model/docker.ts Lines 35 to 89 in 461ecf7
We would have to add something like this:
And maybe for the windows based docker run command too? And then, could be used with something like this in the workflow file: - name: Build with Docker
run: |
# Your build steps here
with:
dockerRegistryMirrors: |
- https://mirror1.example.com
- https://mirror2.example.com If this is absolutely necessary, don't forget that you can fork the repository, update the code and try it 👍 |
Hi! @GabLeRoux
Sure, as the first use case - recently some political games happened and docker hub restricted access to machines from Russia where my runner is located. For sure it doesn't anyhow restrict the access as I can enable proxy/vpn on it. Outside of the game-ci people using mirrors like Google's one or any other but here it's not much flexibility so it will be great to see it. Another reason if someone needs custom docker registry.
Yes, as my runner is located in Russia. |
Instead of "dockerRegistryMirrors" we should probably consider naming this "dockerRegistry", as the protocol is the same across registries, and I'm assuming the mirror is a custom registry and not an actual mirror (correct me if I'm wrong).
That seems like a good enough reason to support this to me. By the way, have you considered using |
@webbertakken as I understood, customImage is only for specifying images not full url? |
Technically speaking, we can use I'm not exactly sure how we could use images on a private registry as a login must happen prior to running docker commands, but there's probably a way for that too. Here are some examples to illustrate how this can be done:
Examples using command line
Note: this is only an example, we do not have images hosted on ghcr.io. |
Context
Currently there's no possibility to change list of docker mirrors
Suggested solution
Will be nice to have variable to set list of mirrors for docker
The text was updated successfully, but these errors were encountered: