Skip to content
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

Docker image build broken #762

Open
s1na opened this issue Dec 16, 2024 · 1 comment
Open

Docker image build broken #762

s1na opened this issue Dec 16, 2024 · 1 comment

Comments

@s1na
Copy link

s1na commented Dec 16, 2024

I'm trying to build a docker image from source and it is failing on master and dev-upgrade, whereas normal make XDC works. Here is the error log:

...
5.972 go: downloading github.com/consensys/bavard v0.1.13
6.016 go: downloading rsc.io/tmplfunc v0.0.3
6.209 # cd /XDPoSChain; git status --porcelain
6.209 fatal: not a git repository (or any of the parent directories): .git
6.210 error obtaining VCS status: exit status 128
6.210 	Use -buildvcs=false to disable VCS stamping.
6.211 util.go:43: exit status 1
6.211 exit status 1
6.219 make: *** [Makefile:14: XDC] Error 1
------

 1 warning found (use docker --debug to expand):
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1)
Dockerfile:6
--------------------
   4 |
   5 |     ADD . /XDPoSChain
   6 | >>> RUN cd /XDPoSChain && make XDC
   7 |
   8 |     FROM alpine:latest
--------------------
ERROR: failed to solve: process "/bin/sh -c cd /XDPoSChain && make XDC" did not complete successfully: exit code: 2
@s1na
Copy link
Author

s1na commented Dec 17, 2024

I have been able to get it to build with this patch:

diff --git a/build/ci.go b/build/ci.go
index 7d09ec7c9..bf0ffe377 100644
--- a/build/ci.go
+++ b/build/ci.go
@@ -180,6 +180,7 @@ func buildFlags(env build.Environment) (flags []string) {
 	if len(ld) > 0 {
 		flags = append(flags, "-ldflags", strings.Join(ld, " "))
 	}
+	flags = append(flags, "-buildvcs=false")
 	return flags
 }

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

1 participant