bazelbuild / rules_docker

Rules for building and handling Docker images with Bazel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unclear tarball warning caused by container_run_and_commit

bjencks opened this issue Β· comments

🐞 bug report

Affected Rule / regression

This is a documentation / warning text issue; actual behavior is fine.

Description

The documentation doesn't make any mention of the outfiles of container_run_and_commit including a tarball, so the minimal repro is not obviously the cause of the warning message seen. Either the warning should mention this possibility, or the container_run_and_commit docs should mention that it's not appropriate to use as a base for container_image.

I did eventually figure out that using container_run_and_commit_layer is the fix here (see good branch), I just think doing the right thing should be more obvious.

πŸ”¬ Minimal Reproduction

https://github.com/bjencks/bazeldocker/tree/bad

container_run_and_commit(
    name = "exec",
    image = "@fedora37//image",
    commands = [ 
		"touch /root/testfile",
    ],
)

container_image(
	name = "out",
	base = ":exec",
)

πŸ”₯ Exception or Error

DEBUG: /home/codespace/.cache/bazel/_bazel_codespace/5445a3e23ee92b26d38dbf0d49fabf34/external/io_bazel_rules_docker/container/push.bzl:80:14: Pushing an image based on a tarball can be very expensive. If the image set on @//:push is the output of a docker_build, consider dropping the '.tar' extension. If the image is checked in, consider using container_import instead.

🌍 Your Environment

Operating System:

Default codespaces environment

Output of bazel version:

  
Bazelisk version: v1.15.0
Build label: 6.0.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Mon Dec 19 15:52:35 2022 (1671465155)
Build timestamp: 1671465155
Build timestamp as int: 1671465155
  

Rules_docker version:

  
v0.25.0
  

Anything else relevant?

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?"