bazel-contrib / rules_oci

Bazel rules for building OCI containers
Apache License 2.0
305 stars 159 forks source link

Document how to pull an image from docker hub #704

Closed qdii closed 5 days ago

qdii commented 1 month ago

I'm struggling to find how to simply pull an image from dockerhub.

I have the image qdii/python-3.11-slim-libpq:latest. How I can pull it and make it available under @python?

My latest attempts failed:

oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
    name = "python",
    tag = "latest",
    image = "qdii/python-3.11-slim-libpq",
    platforms = [
        "linux/amd64",
        "linux/arm/v7",
        "linux/arm64",
    ],
)
thesayyn commented 1 month ago

Your snippet here looks okay to me, what is it that not working for you?

gfrankliu commented 5 days ago

@qdii what error did you see?

instead of image = "qdii/python-3.11-slim-libpq", , can you try image = "docker.io/qdii/python-3.11-slim-libpq", ?

qdii commented 5 days ago

Sorry, the failure was totally unrelated to this project. I'll close this as working as intended.