Allow oci_push to use plain HTTP for a specific host. #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now, we can only push to HTTPS, which is creating some problems for a project I'm working on where we'd really like to push to a local registry container. We can in theory add a self-signed cert to that registry container, but the hoops you have to jump through to make that work on Docker Desktop for Mac are considerable and definitely require manual intervention, so it'd be really, really nice if we could instead optionally push to a
http
host.This adds a new attribute to
oci_push
,plain_http_host
, which is a string value for a Docker registry host, including port if needed. This is an optional attribute, defaulting to the empty string. It'll be passed to theocitool
call as--plain-http-host="<value>"
, and onwards from there toResolverWithHeaders
and on tocredhelper.RegistryHostsFromDockerConfig
. If it's non-empty, the returneddocker.RegistryHosts
function will check if thehost
parameter matchesplainHTTPHost
, and if so, it'll change theScheme
for the host fromhttps
to `http.