Open nikonikolov opened 6 months ago
Correct use of repository
is to include everything including the image name. distribution-spec doesn't say anything about image name and that what we conform to here.
Image name seems to be a distinction made by AR.
Thanks. In that case, what's the correct way of tagging the image as the separate crane tagging commands don't seem to work with GCP.
After a bit of back and forth, here is the correct BUILD config to push to GCP Artifact Registry:
Assuming:
# Publish image to registry
oci_push(
name = "push",
image = ":image",
repository = "asia-northeast1-docker.pkg.dev/my-project/my-bazel-repo/moby",
remote_tags = ["latest"],
visibility = ["//visibility:public"],
)
That way, push works as expected. There is absolutely nothing broken, afaik.
Only the documentation could need an example.
oci_push
doesn't seem to work with GCP Artifact Registry (or maybe I am doing something wrong).GCP quick start instructions here https://cloud.google.com/artifact-registry/docs/docker/store-docker-container-images say that when using docker, the pattern for pushing an image is:
If I follow this with
oci_push
I get an error
Looking at the generated push script, indeed crane doesn't seem to follow the above pattern
In
oci_push
when I change therepository
argument to include the image nameus-central1-docker.pkg.dev/my-project/quickstart-docker-repo/quickstart-image
, pushing seems to work. However,repository
is no longer accurate description of the argument. Furthermore, tagging operations run bycrane
at the end of the script don't seem to be supported on GCP and I getunexpected status code 405 Method Not Allowed (HEAD responses have no body, use GET for details)
.P.S. Definitely not an authentication issue since I can push the image without a problem using
docker push