Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Unable to build image #2993

Closed
sid226 opened this issue Oct 20, 2020 · 2 comments
Closed

Unable to build image #2993

sid226 opened this issue Oct 20, 2020 · 2 comments

Comments

@sid226
Copy link

sid226 commented Oct 20, 2020

Hi,

I've been trying to build the image gcr.io/gcp-runtimes/ubuntu_16_0_4:latest
using following commands with
bazel 3.6.0
Docker version 19.03.8
OS : "Ubuntu18.04"

bazel run   //ubuntu:bootstrap_ubuntu_16_0_4 

output:

base-images-docker/ubuntu# bazel run   //ubuntu:bootstrap_ubuntu_16_0_4
DEBUG: Rule 'bazel_skylib' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "f83cb8dd6f5658bc574ccd873e25197055265d1c", shallow_since = "1543273402 -0500" and dropping ["tag"]
DEBUG: Repository bazel_skylib instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule git_repository defined at:
  /root/.cache/bazel/_bazel_root/7ca5a63e7fc307a47a39afc1190ef7e9/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
DEBUG: Rule 'distroless' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1553880894 -0400"
DEBUG: Repository distroless instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule git_repository defined at:
  /root/.cache/bazel/_bazel_root/7ca5a63e7fc307a47a39afc1190ef7e9/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
ERROR: /root/siddesh/bazel/base-images-docker/store/git/BUILD:17:10: no such package '@bazel_tools//third_party/py/gflags': BUILD file not found in directory 'third_party/py/gflags' of external repository @bazel_tools. Add a BUILD file to a directory to mark it as a package. and referenced by '//store/git:git'
ERROR: Analysis of target '//ubuntu:bootstrap_ubuntu_16_0_4' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.501s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (2 packages loaded, 0 targets configured)
FAILED: Build did NOT complete successfully (2 packages loaded, 0 targets configured)
    Fetching @local_config_cc; fetching
    Fetching @six; fetching

Is this the correct approach ? Any help would be appreciated.

I was not able to build image using official steps here : https://github.com/GoogleContainerTools/base-images-docker/blob/master/CONTRIB.md
#2867 .

@sid226 sid226 changed the title Unable to build image without gcloud Unable to build image Oct 20, 2020
@sid226
Copy link
Author

sid226 commented Oct 23, 2020

Looks like error is related to bazelbuild/bazel#11564
was able to build the image with old bazel binary 2.2.0. and following patch

diff --git a/ubuntu/BUILD b/ubuntu/BUILD
index d296e08..3a52490 100644
--- a/ubuntu/BUILD
+++ b/ubuntu/BUILD
@@ -66,7 +66,7 @@ genrule(

 bootstrap_image_macro(
     name = "bootstrap_ubuntu_16_0_4",
-    date = "20190409",
+    date = "20190301",
     image_tar = ":ubuntu_16_0_4_vanilla.tar",
     output_image_name = "ubuntu_16_0_4",
     packages = [
@@ -80,7 +80,7 @@ bootstrap_image_macro(

 bootstrap_image_macro(

command

bazel run //ubuntu:bootstrap_ubuntu_16_0_4 --action_env=GIT_ROOT=<dir>/base-images-docker --sandbox_writable_path=<dir>/base-images-docker --verbose_failures

@sid226
Copy link
Author

sid226 commented Sep 21, 2021

closing this, as issue was resolved with old bazel binary 2.2.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant