WSLc: Support pushing to a different registry / repository
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
**Is your feature request related to a problem? Please describe.**
`podman` and `buildah` both support pushing to a named remote. E.g. one can do `podman push []`. WSLc currently assumes that all images are under the `docker.io` top-level namespace and doesn't seem to support [configuring registries like podman do](https://www.redhat.com/en/blog/container-image-short-names) and doesn't let one push a non-matching image name, which looks like it would be easy to implement.
See Also: #40951
**Describe the solution you'd like**
What podman has implemented:
```
% podman push --help
Push an image to a specified destination
Description:
Pushes a source image to a specified destination.
The Image "DESTINATION" uses a "transport":"details" format. See podman-push(1) section "DESTINATION" for the expected format.
Usage:
podman push [options] IMAGE [DESTINATION]
Examples:
podman push imageID docker://registry.example.com/repository:tag
podman push imageID oci-archive:/path/to/layout:image:tag
```
Going further, I think going with what podman has implemented - a config file where the registries are listed, and can be configured. This file can then be managed by corporations that wish to use their internal proxy / mirror. But in the short term, having an extra argument for push would make sense.
**Describe alternatives you've considered**
I can work around this by doing it the docker way - tagging and then pushing, or building with `-t myregistry/myimage:mytag`. That's what the docker CLI recommend, although it feels a bit clumsy.
**Additional context**
- [The docker way](https://docs.docker.com/reference/cli/docker/image/push/)
- [`man podman-push`](https://docs.podman.io/en/stable/markdown/podman-push.1.html)
- [`/etc/containers/registries.conf` blog post by Red Hat](https://www.redhat.com/en/blog/container-image-short-names)
Contributor guide
Research direction
Start by locating the WSLc push command and its current image naming and registry assumptions. Compare its behavior with the documented podman push IMAGE DESTINATION form and the referenced registry configuration approach. Done means a source image can be pushed to a different registry or repository, with the supported configuration or argument behavior documented and tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100