admin管理员组文章数量:1221304
I want to install a package (in this case, r-base
) as a layer in my oci_image. My (not-quite-working) code looks like this:
# ============
# MODULE.bazel
# ============
oci.pull(
name = "databricksruntime",
digest = "sha256:601cf3720547f3a28847071915b1f3f3a633746cac796bf9f4ed0b7592574ec3",
image = "index.docker.io/databricksruntime/standard",
)
oci.pull(
name = "r_base",
digest = "sha256:feaff63863ff449976a4ba3935ef815b77236294f52c5e7749a179092772a456",
image = "index.docker.io/library/r-base",
)
use_repo(oci, "databricksruntime", "r_base")
# ===========
# BUILD.bazel
# ===========
oci_image(
name = "image",
base = "@databricksruntime",
tars = [
"@r_base",
],
)
At build time, however, my Bazel command fails:
> bazel build //path_to_my:image
File "/private/var/tmp/_bazel_stephengross/388d8b385f2abe50aa216c398c4790da/external/rules_oci~/oci/private/image.bzl", line 189, column 43, in _oci_image_impl
descriptor = _calculate_descriptor(ctx, i, layer, zstd, jq, coreutils, regctl)
File "/private/var/tmp/_bazel_stephengross/388d8b385f2abe50aa216c398c4790da/external/rules_oci~/oci/private/image.bzl", line 106, column 13, in _calculate_descriptor
args.add(layer)
Error in add: Cannot add directories to Args#add since they may expand to multiple values. Either use Args#add_all (if you want expansion) or args.add(directory.path) (if you do not).
Unsurprisingly, my reference to @r_base
(as a tar
) is not working. I suspect there's some Bazel magic to wrap @r_base
into a tar; thus far my attempts (tar(...); pkg_tar(...)
, etc.) have failed. Any pointers on getting the oci.pull()
-obtained repo as a tar
layer in oci_image
are appreciated!
本文标签: containersHow to include a tar (obtained via ocipull()) in an ociimageStack Overflow
版权声明:本文标题:containers - How to include a tar (obtained via oci.pull()) in an oci_image? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1739359977a2159774.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论