static-container-registry icon indicating copy to clipboard operation
static-container-registry copied to clipboard

added support for defining prefixes as : in the fs

Open dxlr8r opened this issue 5 years ago • 6 comments

Great project. However, we need to be able to add support for prefixes without defining it for all repositories.

Now I can do:

$ skopeo copy --format v2s2 --dest-compress docker://docker.io/foo/bar:latest dir:images/foo:bar/latest

And I can pull it as normal:

$ docker pull myregistry/foo/bar:latest

dxlr8r avatar Dec 08 '20 14:12 dxlr8r

I'm afraid I don't fully understand what this PR brings... Could you explain a bit more? Thank you!

NicolasT avatar Dec 17 '20 21:12 NicolasT

When using helm charts, plain old regular yml files, etc. with Kubernetes, they have the prefix (if any) already defined. One definition might be:

image: aaa/xxx:v1.0.0

Another:

image: yyy:latest

So for using static-container-registry with Kubernetes resources, without manually altering all charts etc., one needs the possibility to define the prefix, or remove it, per image.

dxlr8r avatar Jan 06 '21 09:01 dxlr8r

Ah, I think I get it now. In the project for which this tools was initially developed we have something similar, but there we keep all images that have a different prefix in other directories (could be subdirectories of your images/), then run this tool multiple times, once for each subdirectory, with the appropriate prefix. Finally, all resulting configs are included in the nginx config.

NicolasT avatar Jan 13 '21 16:01 NicolasT

Ahhh, I see. Yes, that is possible as well. For us, that approach will require more steps to automate.

I do prefer the way suggested in the pull request, but I could your method work for us as well.

dxlr8r avatar Jan 13 '21 17:01 dxlr8r

Fair enough :) Seems like a useful feature.

Could you add some tests to the suite to validate the changes? There may be a way to calculate the sname once instead of having multiple replace calls.

Looks like TravisCI isn't picking up the PR either, and DockerCloud tests is broken sigh. I'll need to look into that.

NicolasT avatar Jan 14 '21 13:01 NicolasT

Could you add some tests to the suite to validate the changes? There may be a way to calculate the sname once instead of having multiple replace calls.

This is my first experience with Python, hardly coded a single line outside of "hello worlds". The "sname" was more a proof of concept, I do not know if that is the best name either.

I'll see what I can manage.

dxlr8r avatar Jan 14 '21 13:01 dxlr8r