cpuguy83 / docker-log-driver-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to build image

AlexeyBeley opened this issue · comments

Hi, trying to build:

[username@ip-1-1-1-10 docker-log-driver-test]#  git clone https://github.com/cpuguy83/docker-log-driver-test.git
[username@ip-1-1-1-10 docker-log-driver-test]#  cd docker-log-driver-test
[username@ip-1-1-1-10 docker-log-driver-test]# docker build -t docker-log-driver-test -f Dockerfile.build .
Sending build context to Docker daemon  115.2kB
Step 1/3 : FROM  golang:1.7
1.7: Pulling from library/golang
ad74af05f5a2: Pull complete 
2b032b8bbe8b: Pull complete 
a9a5b35f6ead: Pull complete 
25d9840c55bc: Pull complete 
abeecada453e: Pull complete 
98b5f0802231: Pull complete 
aca2591b4a7e: Pull complete 
Digest: sha256:93b2b52f1212e97b6650bde1f20f6a359b08c117c57a848970d615fe88623a3d
Status: Downloaded newer image for golang:1.7
 ---> 225948c9a8b1
Step 2/3 : COPY . /go/src/github.com/cpuguy83/docker-log-driver
 ---> 0e8955de03a5
Step 3/3 : RUN cd /go/src/github.com/cpuguy83/docker-log-driver && go get && go build --ldflags '-extldflags "-static"' -o /usr/bin/docker-log-driver
 ---> Running in 602b009da833
# golang.org/x/net/proxy
/go/src/golang.org/x/net/proxy/proxy.go:83: u.Hostname undefined (type *url.URL has no field or method Hostname)
/go/src/golang.org/x/net/proxy/proxy.go:84: u.Port undefined (type *url.URL has no field or method Port)
The command '/bin/sh -c cd /go/src/github.com/cpuguy83/docker-log-driver && go get && go build --ldflags '-extldflags "-static"' -o /usr/bin/docker-log-driver' returned a non-zero code: 2

Searched in web and change GO version to 1.8, but still have problems:

[username@ip-1-1-1-10 docker-log-driver-test]# vi Dockerfile.build 
[username@ip-1-1-1-10 docker-log-driver-test]# docker build -t docker-log-driver-test -f Dockerfile.build .
Sending build context to Docker daemon  115.2kB
Step 1/3 : FROM  golang:1.8
1.8: Pulling from library/golang
4176fe04cefe: Pull complete 
851356ecf618: Pull complete 
6115379c7b49: Pull complete 
69914558965c: Pull complete 
b108f9aa98db: Pull complete 
df7abcd2981e: Pull complete 
3e60cb3f592b: Pull complete 
Digest: sha256:f0b5dab7581eddb49dabd1d1b9aa505ca3edcdf79a66395b5bfa4f3c036b49ef
Status: Downloaded newer image for golang:1.8
 ---> 0d283eb41a92
Step 2/3 : COPY . /go/src/github.com/cpuguy83/docker-log-driver
 ---> 48d7aea34ff0
Step 3/3 : RUN cd /go/src/github.com/cpuguy83/docker-log-driver && go get && go build --ldflags '-extldflags "-static"' -o /usr/bin/docker-log-driver
 ---> Running in c798dd7a766b
# github.com/cpuguy83/docker-log-driver
./driver.go:106: msg.Partial undefined (type logger.Message has no field or method Partial)
./driver.go:137: watcher.Close undefined (type *logger.LogWatcher has no field or method Close)
./driver.go:149: msg.Partial undefined (type *logger.Message has no field or method Partial)
The command '/bin/sh -c cd /go/src/github.com/cpuguy83/docker-log-driver && go get && go build --ldflags '-extldflags "-static"' -o /usr/bin/docker-log-driver' returned a non-zero code: 2

[username@ip-1-1-1-10 docker-log-driver-test]#  docker version
Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a215d7133c34aa18e3b72b4a21fd0c6136
 Built:             Mon Jan 28 20:25:39 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a/18.06.1-ce
  Built:            Mon Jan 28 20:27:05 2019
  OS/Arch:          linux/amd64
  Experimental:     false

Did you see this anywhere before?
Thanks.

This is due to the version of docker (code) you are pulling in to compile since those types changed.

@AlexeyBeley did you ever resolve this? I'm trying to build the image from the Dockerfile on master and am getting this error:

1.11.5: Pulling from library/golang
22dbe790f715: Pull complete
0250231711a0: Pull complete
6fba9447437b: Pull complete
c2b4d327b352: Pull complete
619f4932b7ea: Pull complete
e2fd6cbd3c6f: Pull complete
1d96446d2b20: Pull complete
Digest: sha256:342872745847966ab630e9cc5b6980ed3fe7f4e3ea44b10efac995575730c9b8
Status: Downloaded newer image for golang:1.11.5
 ---> 1454e2b3d01f
Step 2/3 : COPY . /go/src/github.com/cpuguy83/docker-log-driver
 ---> 41b50d3db799
Step 3/3 : RUN cd /go/src/github.com/cpuguy83/docker-log-driver && go get && go build --ldflags '-extldflags "-static"' -o /usr/bin/docker-log-driver
 ---> Running in e2c63324be66
# github.com/docker/docker/vendor/github.com/containerd/containerd/errdefs
../../docker/docker/vendor/github.com/containerd/containerd/errdefs/errors.go:54:9: undefined: "github.com/docker/docker/vendor/github.com/pkg/errors".Is
../../docker/docker/vendor/github.com/containerd/containerd/errdefs/errors.go:59:9: undefined: "github.com/docker/docker/vendor/github.com/pkg/errors".Is
../../docker/docker/vendor/github.com/containerd/containerd/errdefs/errors.go:65:9: undefined: "github.com/docker/docker/vendor/github.com/pkg/errors".Is
../../docker/docker/vendor/github.com/containerd/containerd/errdefs/errors.go:71:9: undefined: "github.com/docker/docker/vendor/github.com/pkg/errors".Is
../../docker/docker/vendor/github.com/containerd/containerd/errdefs/errors.go:76:9: undefined: "github.com/docker/docker/vendor/github.com/pkg/errors".Is
../../docker/docker/vendor/github.com/containerd/containerd/errdefs/errors.go:81:9: undefined: "github.com/docker/docker/vendor/github.com/pkg/errors".Is
../../docker/docker/vendor/github.com/containerd/containerd/errdefs/errors.go:86:9: undefined: "github.com/docker/docker/vendor/github.com/pkg/errors".Is
../../docker/docker/vendor/github.com/containerd/containerd/errdefs/errors.go:92:9: undefined: "github.com/docker/docker/vendor/github.com/pkg/errors".Is
The command '/bin/sh -c cd /go/src/github.com/cpuguy83/docker-log-driver && go get && go build --ldflags '-extldflags "-static"' -o /usr/bin/docker-log-driver' returned a non-zero code: 2