Skip to content

Cannot build docker image #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shouichi opened this issue Mar 8, 2022 · 3 comments
Closed

Cannot build docker image #192

shouichi opened this issue Mar 8, 2022 · 3 comments

Comments

@shouichi
Copy link

shouichi commented Mar 8, 2022

Step to reproduce

$ docker build -t copybara .                                                    
Sending build context to Docker daemon  18.48MB
Step 1/15 : FROM l.gcr.io/google/bazel:latest AS build
 ---> 5cac8433a9d7
Step 2/15 : WORKDIR /usr/src/copybara
 ---> Using cache
 ---> 00085dbf43a2
Step 3/15 : COPY . .
 ---> dbdf702f1c0a
Step 4/15 : RUN bazel build //java/com/google/copybara:copybara_deploy.jar     && mkdir -p /tmp/copybara     && cp bazel-bin/java/com/google/copybara/copybara_deploy.jar /tmp/copybara/
 ---> Running in 63e1f886f82a
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (1 packages loaded, 0 targets configured)
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (8 packages loaded, 6 targets configured)
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (9 packages loaded, 6 targets configured)
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (9 packages loaded, 6 targets configured)
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (9 packages loaded, 6 targets configured)
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (9 packages loaded, 6 targets configured)
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (45 packages loaded, 749 targets configured)
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (45 packages loaded, 749 targets configured)
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (45 packages loaded, 749 targets configured)
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (46 packages loaded, 859 targets configured)
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (46 packages loaded, 859 targets configured)
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (47 packages loaded, 899 targets configured)
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (55 packages loaded, 1068 targets configured)
Analyzing: target //java/com/google/copybara:copybara_deploy.jar (55 packages loaded, 1068 targets configured)
INFO: Analyzed target //java/com/google/copybara:copybara_deploy.jar (56 packages loaded, 1194 targets configured).
INFO: Found 1 target...
[0 / 137] [Prepa] BazelWorkspaceStatusAction stable-status.txt
[75 / 160] Building third_party/bazel/libshell.jar (17 source files); 1s worker ... (8 actions running)
ERROR: /usr/src/copybara/java/com/google/copybara/profiler/BUILD:19:13: Building java/com/google/copybara/profiler/libprofiler.jar (6 source files) failed (Exit 1)
java/com/google/copybara/profiler/LogProfilerListener.java:36: error: cannot find symbol
    StackWalker.getInstance()
    ^
  symbol:   variable StackWalker
  location: class LogProfilerListener
Target //java/com/google/copybara:copybara_deploy.jar failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 46.103s, Critical Path: 8.40s
INFO: 87 processes: 71 processwrapper-sandbox, 16 worker.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
The command '/bin/sh -c bazel build //java/com/google/copybara:copybara_deploy.jar     && mkdir -p /tmp/copybara     && cp bazel-bin/java/com/google/copybara/copybara_deploy.jar /tmp/copybara/' returned a non-zero code: 1

The problem seems to be the java version. The base image's (l.gcr.io/google/bazel) version is 8 but the minimum required version is 11.

Thanks.

@politician
Copy link
Contributor

PR is pending

Until then, see here for a working image.

@qqaatw
Copy link

qqaatw commented Aug 2, 2022

@politician Hi, thanks for the fix.

I got an error suggesting that the go get command has been deprecated and one should use go install instead:

copybara/Dockerfile

Lines 22 to 23 in 3b0e0e6

RUN go get github.com/bazelbuild/buildtools/buildozer
RUN go get github.com/bazelbuild/buildtools/buildifier

@mikelalcon
Copy link
Collaborator

#186 is merged

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

No branches or pull requests

4 participants