You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a command that maps image references in Dockerfiles to Chainguard.
It attempts to be as low touch as possible, leaving the file formatted
exactly as it is and just replacing the images where it finds them.
As part of this I've refactored the tag matching logic because I wanted
to only map to -dev tags, unless the image has no -dev tags at all. This
wasn't possible with the abstraction I was previously using.
rootCmd.Flags().StringVar(&opts.Repo, "repository", "cgr.dev/chainguard", "Modifies the repository URI in the mappings. For instance, registry.internal.dev/chainguard would result in registry.internal.dev/chainguard/<image> in the output.")
Short: "Map image references in a Dockerfile to their Chainguard equivalents.",
20
+
Example: `
21
+
# Map a Dockerfile
22
+
image-mapper map dockerfile Dockerfile
23
+
24
+
# Map a Dockerfile from stdin
25
+
cat Dockerfile | image-mapper map dockerfile -
26
+
27
+
# Override the repository in the mappings with your own mirror or proxy. For instance, cgr.dev/chainguard/<image> would become registry.internal/cgr/<image> in the output.
cmd.Flags().StringVar(&opts.Repo, "repository", "cgr.dev/chainguard", "Modifies the repository URI in the mappings. For instance, registry.internal.dev/chainguard would result in registry.internal.dev/chainguard/<image> in the output.")
0 commit comments