rules_docker icon indicating copy to clipboard operation
rules_docker copied to clipboard

Error on `bazel run`ing a `go_image` target

Open oczkoisse opened this issue 2 years ago • 0 comments

🐞 bug report

Affected Rule

The issue is caused by the go_image rule but it could also be affecting other lang_image rules and container_image rule (with set entrypoint and legacy_run_behavior set to False).

Is this a regression?

I am not sure.

Description

The docs state that

You can load this into your local Docker client by running: bazel run my/image:helloworld.

For the lang_image targets, this will also run the container using docker run to maximize compatibility with lang_binary rules.

However, bazel runing a go_image target results in

error getting current working directory: No such file or directory

🔬 Minimal Reproduction

Clone the repository and invoke bazel run hello.

🔥 Exception or Error


INFO: Analyzed target //:hello (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //:hello up-to-date:
  bazel-out/k8-fastbuild-ST-4a519fd6d3e4/bin/hello-layer.tar
INFO: Elapsed time: 0.103s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
Getting image source signatures
Copying blob 8c4c85a9b0ff skipped: already exists  
Copying blob 0b3d0512394d skipped: already exists  
Copying blob 6d75f23be3dd skipped: already exists  
Copying config a3c74290ab done  
Writing manifest to image destination
Storing signatures
Loaded image(s): sha256:a3c74290ab5babf7171dbe21c4121f9ef1cdaedeec6f999b0a8020a8ce1c5ffa
Tagging a3c74290ab5babf7171dbe21c4121f9ef1cdaedeec6f999b0a8020a8ce1c5ffa as bazel:hello
error getting current working directory: No such file or directory

🌍 Your Environment

Operating System:

  
Debian GNU/Linux rodete [5.17.11-1rodete2-amd64]
  

Output of bazel version:

  
Bazelisk version: v1.12.0
Build label: 5.2.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jun 7 16:02:26 2022 (1654617746)
Build timestamp: 1654617746
Build timestamp as int: 1654617746
  

Rules_docker version:

  
v0.25.0
  

oczkoisse avatar Jul 21 '22 22:07 oczkoisse