【发布时间】:2017-11-21 18:39:37
【问题描述】:
根据 bazelbuild/rules_docker 上的文档,应该可以在 OSX 上使用这些容器映像,并且它还声称可以在没有 docker 的情况下这样做。
These rules do not require / use Docker for pulling, building, or pushing images. This means:
They can be used to develop Docker containers on Windows / OSX without boot2docker or docker-machine installed.
They do not require root access on your workstation.
我该怎么做?这是一个简单的规则:
go_image(
name = "helloworld_image",
importpath = "github.com/nictuku/helloworld",
library = ":go_default_library",
visibility = ["//visibility:public"],
)
我可以使用bazel build :helloworld_image构建图像。它会在 blaze-bin 中生成一个 tar 球,但不会运行它:
INFO: Running command line: bazel-bin/helloworld_image
Loaded image ID: sha256:08d312b529d30431c68741fd3a31468a02533f27a8c2c29eedc969dae5a39852
Tagging 08d312b529d30431c68741fd3a31468a02533f27a8c2c29eedc969dae5a39852 as bazel:helloworld_image
standard_init_linux.go:185: exec user process caused "exec format error"
ERROR: Non-zero return code '1' from command: Process exited with status 1.
它试图运行 linux 这是 OSX,这很愚蠢。
我还尝试对 .tar 内容执行“docker load”,但它似乎不喜欢这种格式。
帮助?谢谢!
【问题讨论】:
标签: bazel