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 build fails: GCC missing #263

Closed
cwchristerw opened this issue Dec 17, 2018 · 10 comments
Closed

Docker build fails: GCC missing #263

cwchristerw opened this issue Dec 17, 2018 · 10 comments
Assignees
Labels
bug This shouldn't happen docker Operating system-specific

Comments

@cwchristerw
Copy link
Contributor

cwchristerw commented Dec 17, 2018

Sending build context to Docker daemon  1.857MB
Step 1/11 : FROM docker.io/golang:alpine as builder
alpine: Pulling from library/golang
4fe2ade4980c: Already exists 
2e793f0ebe8a: Pull complete 
77995fba1918: Pull complete 
6b343150750a: Pull complete 
517b41dec3aa: Pull complete 
Digest: sha256:c2c6c46c11319fd458a42aa3fc3b45e16bacb49e3f33f1e2a783f0122a9d8471
Status: Downloaded newer image for golang:alpine
 ---> c283ac5a8f78
Step 2/11 : COPY . /src
 ---> cf9ea15c0cb2
Step 3/11 : WORKDIR /src
 ---> Running in dc146e239edb
Removing intermediate container dc146e239edb
 ---> dc31857e35f0
Step 4/11 : RUN apk add git && ./build
 ---> Running in 233c86601e75
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/6) Installing nghttp2-libs (1.32.0-r0)
(2/6) Installing libssh2 (1.8.0-r3)
(3/6) Installing libcurl (7.61.1-r1)
(4/6) Installing expat (2.2.5-r0)
(5/6) Installing pcre2 (10.31-r0)
(6/6) Installing git (2.18.1-r0)
Executing busybox-1.28.4-r1.trigger
OK: 19 MiB in 20 packages
Building: yggdrasil
Fetching https://golang.org/x/crypto?go-get=1
Fetching https://golang.org/x/net?go-get=1
Fetching https://golang.org/x/text?go-get=1
Fetching https://golang.org/x/sys?go-get=1
go: finding github.com/kardianos/minwinsvc v0.0.0-20151122163309-cad6b2b879b0
go: finding github.com/neilalexander/hjson-go v0.0.0-20180509131856-23267a251165
go: finding github.com/docker/libcontainer v2.2.1+incompatible
go: finding github.com/mitchellh/mapstructure v1.1.2
go: finding github.com/songgao/packets v0.0.0-20160404182456-549a10cd4091
go: finding github.com/yggdrasil-network/water v0.0.0-20180615095340-f732c88f34ae
Parsing meta tags from https://golang.org/x/sys?go-get=1 (status code 200)
get "golang.org/x/sys": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at https://golang.org/x/sys?go-get=1
Parsing meta tags from https://golang.org/x/crypto?go-get=1 (status code 200)
Parsing meta tags from https://golang.org/x/net?go-get=1 (status code 200)
get "golang.org/x/crypto": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto?go-get=1
get "golang.org/x/net": found meta tag get.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net?go-get=1
go: finding golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e
go: finding golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9
go: finding golang.org/x/net v0.0.0-20181207154023-610586996380
Parsing meta tags from https://golang.org/x/text?go-get=1 (status code 200)
get "golang.org/x/text": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text?go-get=1
go: finding golang.org/x/text v0.3.0
go: downloading github.com/mitchellh/mapstructure v1.1.2
go: downloading golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9
go: downloading github.com/songgao/packets v0.0.0-20160404182456-549a10cd4091
go: downloading github.com/kardianos/minwinsvc v0.0.0-20151122163309-cad6b2b879b0
go: downloading golang.org/x/text v0.3.0
go: downloading golang.org/x/net v0.0.0-20181207154023-610586996380
go: downloading golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e
go: downloading github.com/yggdrasil-network/water v0.0.0-20180615095340-f732c88f34ae
go: downloading github.com/docker/libcontainer v2.2.1+incompatible
go: downloading github.com/neilalexander/hjson-go v0.0.0-20180509131856-23267a251165
github.com/kardianos/minwinsvc
golang_org/x/net/dns/dnsmessage
github.com/yggdrasil-network/yggdrasil-go/src/config
github.com/neilalexander/hjson-go
github.com/yggdrasil-network/yggdrasil-go/src/defaults
github.com/yggdrasil-network/water
golang.org/x/crypto/ed25519/internal/edwards25519
golang.org/x/crypto/curve25519
golang.org/x/crypto/internal/subtle
golang.org/x/crypto/poly1305
net
golang.org/x/crypto/ed25519
# net
exec: "gcc": executable file not found in $PATH
golang.org/x/crypto/salsa20/salsa
golang.org/x/net/internal/iana
golang.org/x/net/bpf
golang.org/x/text/encoding/internal/identifier
golang.org/x/text/transform
golang.org/x/crypto/nacl/secretbox
golang.org/x/text/internal/utf8internal
golang.org/x/crypto/nacl/box
golang.org/x/text/encoding
golang.org/x/text/runes
golang.org/x/text/encoding/internal
golang.org/x/text/encoding/unicode
Building: yggdrasilctl
net
# net
exec: "gcc": executable file not found in $PATH
Removing intermediate container 233c86601e75
 ---> ee4a9e848da0
Step 5/11 : FROM docker.io/alpine
 ---> 11cd0b38bc3c
Step 6/11 : LABEL maintainer="Christer Waren/CWINFO <christer.waren@cwinfo.org>"
 ---> Running in b81b1895d3e4
Removing intermediate container b81b1895d3e4
 ---> 98d0d93df1d1
Step 7/11 : COPY --from=builder /src/yggdrasil /usr/bin/yggdrasil
COPY failed: stat /var/lib/docker/overlay2/77c4f922b88880a5e7bc391f1b4827f93ba3c9a1c1476e5c6af7c1ed8a053441/merged/src/yggdrasil: no such file or directory
@neilalexander
Copy link
Member

I guess the crux of this issue is:

exec: "gcc": executable file not found in $PATH

GCC is not present?

@cwchristerw cwchristerw changed the title Docker build fails Docker build fails: GCC missing Dec 17, 2018
@jcgruenhage
Copy link
Contributor

Yeah, since when do we need gcc though?

@neilalexander
Copy link
Member

I suspect this is related to golang/go#26988 somehow - we are using Go 1.11 modules now, so it looks like the problem is potentially in linking against the native network stack.

Potential solution appears to be specifying CGO_ENABLED=0 at build time.

@cwchristerw
Copy link
Contributor Author

cwchristerw commented Dec 17, 2018

I can make tests and create PR to develop before next release gets pulled from develop branch

@cwchristerw
Copy link
Contributor Author

I suspect this is related to golang/go#26988 somehow - we are using Go 1.11 modules now, so it looks like the problem is potentially in linking against the native network stack.

Potential solution appears to be specifying CGO_ENABLED=0 at build time.

Is it environment variable?

@neilalexander
Copy link
Member

Yes - something like CGO_ENABLED=0 ./build should do the trick.

@neilalexander neilalexander added bug This shouldn't happen docker Operating system-specific labels Dec 17, 2018
@cwchristerw
Copy link
Contributor Author

cwchristerw commented Dec 17, 2018

Build OK, network NOT with that change because my laptop network went down for some reason. Try again if still goes I'm going to try installing gcc and compare results 😄 Don't know command that I can use to check network traffic during test

@jcgruenhage
Copy link
Contributor

If we compile it with cgo, we don't get proper static binaries though, they'll have c libraries as dependencies.

@cwchristerw
Copy link
Contributor Author

cwchristerw commented Dec 17, 2018

Now it works but will have to test few minutes though

@neilalexander
Copy link
Member

@jcgruenhage

Right - so we have more flags we can give to build as per #235. Also see #244 on really static.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This shouldn't happen docker Operating system-specific
Projects
None yet
Development

No branches or pull requests

3 participants