-
Notifications
You must be signed in to change notification settings - Fork 264
Open
Labels
Description
I have tried to build the Docker image locally both using Dockerfile and Dockerfile.DS but it seems to fail.
The build of gophernotes is failing on the go build command.
I tried changing the go interpreter to a previous version but got this:
go: downloading golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375
go: downloading github.com/mattn/go-runewidth v0.0.9
# github.com/cosmos72/gomacro/xreflect
/go/pkg/mod/github.com/cosmos72/gomacro@v0.0.0-20200607151955-647446f8352c/xreflect/value.go:214:16: v.fwd().IsZero undefined (type reflect.Value has no field or method IsZero)
without changing anything the error I am getting is this:
/usr/lib/go/src/internal/reflectlite/value.go:8:2: found packages runtime (alg.go) and trace (annotation.go) in /usr/lib/go/src/runtime
package github.com/gopherdata/gophernotes
imports github.com/cosmos72/gomacro/ast2
imports github.com/cosmos72/gomacro/go/etoken
imports github.com/cosmos72/gomacro/imports
imports plugin
imports runtime/cgo: no Go files in /usr/lib/go/src/runtime/cgo
/go/pkg/mod/github.com/cosmos72/gomacro@v0.0.0-20200607151955-647446f8352c/imports/runtime_debug.go:8:2: no Go files in /usr/lib/go/src/runtime/debug
/go/pkg/mod/github.com/cosmos72/gomacro@v0.0.0-20200607151955-647446f8352c/imports/go1_11/runtime_trace.go:10:2: no Go files in /usr/lib/go/src/runtime/trace
/usr/lib/go/src/crypto/x509/x509.go:37:2: found packages asn1 (asn1.go) and cryptobyte (builder.go) in /usr/lib/go/src/vendor/golang.org/x/crypto/cryptobyte
/usr/lib/go/src/crypto/x509/x509.go:38:2: no Go files in /usr/lib/go/src/vendor/golang.org/x/crypto/cryptobyte/asn1
Tried building the image using docker on OSX and ubuntu.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
adaschevici commentedon Jun 10, 2020
The image built on DockerHub works, but i am not sure what I missed while building it locally, shouldn't it just work?
cosmos72 commentedon Jun 10, 2020
I recently had to make incompatible changes to the go interpreter, with corresponding changes to gophernotes - thus you cannot just mix arbitrary versions: each
go.mod
contains the correct dependencies.Actually, the main issue is
which points to the possible reason:
maybe a new version of Go toolchain was installed in
/usr/lib/go
on top of an older one, without removing the latter first?adaschevici commentedon Jun 10, 2020
Perhaps I did not fully understand what you mean.
What i did:
docker build .
anddocker build --file Dockerfile.DS
Regarding having an earlier go version:
I inserted
RUN go -version
prior to the command and it looked like go isn't installedcosmos72 commentedon Jun 10, 2020
Yes, the docker builds create an environment from scratch.
What I meant is that maybe the
Dockerfile.DS
somehow manages to install Go toolchain twice in the same location, which causes the error you reportedadaschevici commentedon Jun 10, 2020
what i can make out from the Dockerfile is this line adding go
&& apk --update-cache --allow-untrusted \ --repository http://dl-4.alpinelinux.org/alpine/edge/community \ --arch=x86_64 add \ go \
but i can't tell if the following lines are adding go, they don't seem to be adding another toolchain
cosmos72 commentedon Jun 10, 2020
I can't tell either... not a Docker expert at all.
Maybe @SpencerPark can help?
cigoic commentedon Jun 10, 2020
Using Alpine 3.10 should work fine with its latest version of Go (1.14.3-r1).
Please update the Dockerfile.DS with the following codes:
@line 1
FROM alpine:3.10
@line 12, 13
--repository http://dl-4.alpinelinux.org/alpine/v3.10/community \
--repository http://dl-4.alpinelinux.org/alpine/v3.10/main \
@line 25, 26
&& pip3 install --upgrade pip==19.2.3 \
&& ln -s /usr/bin/python3.7 /usr/bin/python \
@line 36
&& pip3 install jupyter notebook pyzmq tornado ipykernel \
@line 67
&& find /usr/lib/python3.7 -name __pycache__ | xargs rm -r \
Build the docker image
docker build --tag test:nb --file Dockerfile.DS .
You could just refer to my revised Dockerfile.DS:
Dockerfile.txt
adaschevici commentedon Jun 10, 2020
awesome, thanks @cigoic that worked