Make oci_image availbale local on docker #327
-
If I type I tried the following: WORKSPACE.bazel: load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
#-------------------------------------------------------
# rules_pkg
#-------------------------------------------------------
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_pkg",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz",
],
sha256 = "8f9ee2dc10c1ae514ee599a8b42ed99fa262b757058f65ad3c384289ff70c4b8",
)
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()
#-------------------------------------------------------
# rules_oci
#-------------------------------------------------------
http_archive(
name = "rules_oci",
sha256 = "176e601d21d1151efd88b6b027a24e782493c5d623d8c6211c7767f306d655c8",
strip_prefix = "rules_oci-1.2.0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.2.0/rules_oci-v1.2.0.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "LATEST_ZOT_VERSION", "oci_register_toolchains")
oci_register_toolchains(
name = "oci",
crane_version = LATEST_CRANE_VERSION,
)
load("@rules_oci//oci:pull.bzl", "oci_pull")
oci_pull(
name = "ubuntu",
image = "ubuntu",
platforms = [
"linux/arm64/v8",
"linux/amd64",
],
digest = "sha256:67211c14fa74f070d27cc59d69a7fa9aeff8e28ea118ef3babc295a0428a6d21",
) BUILD.bazel:
When doing `bazel build //:image" some oci stuff is created under "bazel-bin/image" - not sure how to continue from here... |
Beta Was this translation helpful? Give feedback.
Answered by
thesayyn
Aug 9, 2023
Replies: 1 comment
-
You need an oci_tarball target in order to load the image unto daemon. https://github.com/bazel-contrib/rules_oci/blob/main/docs/tarball.md |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Vertexwahn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need an oci_tarball target in order to load the image unto daemon. https://github.com/bazel-contrib/rules_oci/blob/main/docs/tarball.md