raintank / raintank-docker

raintank docker images and dev stack DEPRECATED / UNMAINTAINED
https://blog.raintank.io/docker-based-development-environment/
16 stars 4 forks source link

unrecognized import path "gopkg.in/fsnotify.v1" #54

Closed Dieterbe closed 8 years ago

Dieterbe commented 8 years ago
##### grafana ####
##### -> docker build -t raintank/grafana .
Sending build context to Docker daemon 6.656 kB
Step 1 : FROM raintank/nodejsgo
 ---> b81ec79c1db8
Step 2 : RUN apt-get update && apt-get -y install supervisor libfontconfig1 libfreetype6 libjpeg8 libstdc++6
 ---> Using cache
 ---> 92878a0b35b3
Step 3 : COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
 ---> Using cache
 ---> 43d8a3431373
Step 4 : RUN mkdir -p /go/src/github.com/grafana
 ---> Using cache
 ---> 783b6569f2a1
Step 5 : RUN mkdir -p /go/src/github.com/raintank
 ---> Using cache
 ---> 288daafcd663
Step 6 : RUN ln -s /go/src/github.com/raintank/grafana /go/src/github.com/grafana/grafana
 ---> Using cache
 ---> 41b1005e01f2
Step 7 : ENV GOPATH /go
 ---> Using cache
 ---> 18884d548edd
Step 8 : ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
 ---> Using cache
 ---> 801783ba55e3
Step 9 : RUN go get -insecure github.com/raintank/grafana || true
 ---> Using cache
 ---> 31a2d7c96d19
Step 10 : RUN go get github.com/Unknwon/bra
 ---> Running in 01732065bea5
package gopkg.in/fsnotify.v1: unrecognized import path "gopkg.in/fsnotify.v1"
The command '/bin/sh -c go get github.com/Unknwon/bra' returned a non-zero code: 1
ERROR: failed building grafana. stopping.

anyone else getting this recently? as you can see below it's ambiguous whether it's a dns lookup error or go error. i suspect it may have something to do with the dns of the motel i'm staying at, but frustratingly go get github.com/Unknwon/bra on my laptop host works fine, but running from docker (using same dns server) seems to fail, even when i add it to /etc/hosts.

~/g/s/g/r/raintank-docker ❯❯❯ docker run 31a2d7c96d19 go get -v -u github.com/Unknwon/bra                                                                                                    ⏎
github.com/Unknwon/bra (download)
github.com/BurntSushi/toml (download)
github.com/Unknwon/com (download)
github.com/Unknwon/log (download)
github.com/codegangsta/cli (download)
Fetching https://gopkg.in/fsnotify.v1?go-get=1
https fetch failed.
import "gopkg.in/fsnotify.v1": https fetch: Get https://gopkg.in/fsnotify.v1?go-get=1: dial tcp: lookup gopkg.in on 10.10.24.1:53: no such host
package gopkg.in/fsnotify.v1: unrecognized import path "gopkg.in/fsnotify.v1"
~/g/s/g/r/raintank-docker ❯❯❯ grep gopkg.in /etc/hosts                                                                                                                                       ⏎
107.178.216.236 gopkg.in
~/g/s/g/r/raintank-docker ❯❯❯ cat /etc/resolv.conf
# Generated by resolvconf
search lan
nameserver 10.10.24.1
Dieterbe commented 8 years ago

been able to make some progress via

diff --git a/grafana/Dockerfile b/grafana/Dockerfile
index b80319a..ccde0ea 100644
--- a/grafana/Dockerfile
+++ b/grafana/Dockerfile
@@ -12,11 +12,11 @@ ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin

 # insecure due to bosun.org issue with cloudflare
 RUN go get -insecure github.com/raintank/grafana || true
-RUN go get github.com/Unknwon/bra
+RUN echo '107.178.216.236 gopkg.in' >> /etc/hosts && go get github.com/Unknwon/bra
 RUN go get github.com/tools/godep
 WORKDIR /go/src/github.com/grafana/grafana
 RUN go run build.go setup
-RUN godep restore
+RUN echo -e '216.58.220.145 golang.org\n64.233.188.82 go.googlesource.com\n107.178.216.236 gopkg.in\n104.16.38.223 bosun.org' >> /etc/hosts && godep restore
 RUN go build .
 RUN npm install && npm install -g grunt-cli && grunt build

cause it would get hung up on all those dns'es.

however it would always find something new to complain about.

Step 13 : RUN go run build.go setup
 ---> Using cache
 ---> 135519c70e17
Step 14 : RUN echo -e '216.58.220.145 golang.org\n64.233.188.82 go.googlesource.com\n107.178.216.236 gopkg.in\n104.16.38.223 bosun.org' >> /etc/hosts && godep restore
 ---> Running in 3a7f11daf2d2
godep: error downloading dep (golang.org/x/net/context): unrecognized import path "golang.org/x/net/context"
godep: error downloading dep (golang.org/x/oauth2): unrecognized import path "golang.org/x/oauth2"
godep: Error downloading some deps. Aborting restore and check.
The command '/bin/sh -c echo -e '216.58.220.145 golang.org\n64.233.188.82 go.googlesource.com\n107.178.216.236 gopkg.in\n104.16.38.223 bosun.org' >> /etc/hosts && godep restore' returned a non-zero code: 1
ERROR: failed building grafana. stopping.

now tried to override the docker daemon dns:

 cat /etc/systemd/system/docker.service.d/override.conf 
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --exec-opt native.cgroupdriver=cgroupfs --dns 8.8.8.8

ps aux | grep docker                                                                                                                                           ⏎
root     22880  0.3  0.1 980464 46160 ?        Ssl  14:02   0:00 /usr/bin/docker daemon -H fd:// --exec-opt native.cgroupdriver=cgroupfs --dns 8.8.8.8

resulting in

Step 10 : RUN go get github.com/Unknwon/bra
 ---> Running in c25e1c10e02a
# cd .; git clone https://github.com/Unknwon/bra /go/src/github.com/Unknwon/bra
Cloning into '/go/src/github.com/Unknwon/bra'...
fatal: unable to access 'https://github.com/Unknwon/bra/': Could not resolve host: github.com
package github.com/Unknwon/bra: exit status 128
The command '/bin/sh -c go get github.com/Unknwon/bra' returned a non-zero code: 1
ERROR: failed building grafana. stopping.
~/g/s/g/r/raintank-docker ❯❯❯ dig @8.8.8.8 github.com

; <<>> DiG 9.10.3-P2 <<>> @8.8.8.8 github.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

thinking my motel wifi dns is really bad and even blocks google dns :?

Dieterbe commented 8 years ago

using 8.8.4.4 works fine and solves all those issues for me /shrug.

Dieterbe commented 8 years ago

for the record, i was also getting

~/g/s/g/r/raintank-docker ❯❯❯ docker pull hopsoft/graphite-statsd                                                                                                                            ⏎
Using default tag: latest
Pulling repository docker.io/hopsoft/graphite-statsd
Error while pulling image: Get https://index.docker.io/v1/repositories/hopsoft/graphite-statsd/images: dial tcp: lookup index.docker.io on 10.10.24.1:53: no such host

even though index.docker.io resolved fine with my local dns as well as 8.8.4.4! i changed resolv.conf to 8.8.4.4 and that made that work as well