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 #5

Closed
jerkyrs opened this issue Jun 4, 2018 · 7 comments
Closed

Docker build fails #5

jerkyrs opened this issue Jun 4, 2018 · 7 comments
Assignees

Comments

@jerkyrs
Copy link
Contributor

jerkyrs commented Jun 4, 2018

What I did

  1. Pull out iotex-core
  2. Run "docker -f Dockerfile ."

What i saw

go clean
rm -f ./bin/server
rm -f ./bin/txinjector
rm -f chain.db
rm -f block.dat
go build -o ./bin/server -v ./server
db/db.go:14:2: cannot find package "github.com/boltdb/bolt" in any of:
        /usr/local/go/src/github.com/boltdb/bolt (from $GOROOT)
        /go/src/github.com/boltdb/bolt (from $GOPATH)
server/main.go:19:2: cannot find package "github.com/golang/protobuf/proto" in any of:
        /usr/local/go/src/github.com/golang/protobuf/proto (from $GOROOT)
        /go/src/github.com/golang/protobuf/proto (from $GOPATH)
db/db.go:12:2: cannot find package "github.com/pkg/errors" in any of:
        /usr/local/go/src/github.com/pkg/errors (from $GOROOT)
        /go/src/github.com/pkg/errors (from $GOPATH)
logger/logger.go:15:2: cannot find package "github.com/rs/zerolog" in any of:
        /usr/local/go/src/github.com/rs/zerolog (from $GOROOT)
        /go/src/github.com/rs/zerolog (from $GOPATH)
crypto/cryptosort.go:13:2: cannot find package "golang.org/x/crypto/blake2b" in any of:
        /usr/local/go/src/golang.org/x/crypto/blake2b (from $GOROOT)
        /go/src/golang.org/x/crypto/blake2b (from $GOPATH)
proto/rpc.pb.go:11:2: cannot find package "golang.org/x/net/context" in any of:
        /usr/local/go/src/golang.org/x/net/context (from $GOROOT)
        /go/src/golang.org/x/net/context (from $GOPATH)
proto/rpc.pb.go:12:2: cannot find package "google.golang.org/grpc" in any of:
        /usr/local/go/src/google.golang.org/grpc (from $GOROOT)
        /go/src/google.golang.org/grpc (from $GOPATH)
network/utils.go:17:2: cannot find package "google.golang.org/grpc/credentials" in any of:
        /usr/local/go/src/google.golang.org/grpc/credentials (from $GOROOT)
        /go/src/google.golang.org/grpc/credentials (from $GOPATH)
config/config.go:15:2: cannot find package "google.golang.org/grpc/keepalive" in any of:
        /usr/local/go/src/google.golang.org/grpc/keepalive (from $GOROOT)
        /go/src/google.golang.org/grpc/keepalive (from $GOPATH)
network/rpcserver.go:17:2: cannot find package "google.golang.org/grpc/peer" in any of:
        /usr/local/go/src/google.golang.org/grpc/peer (from $GOROOT)
        /go/src/google.golang.org/grpc/peer (from $GOPATH)
rpcservice/rpcservice.go:17:2: cannot find package "google.golang.org/grpc/reflection" in any of:
        /usr/local/go/src/google.golang.org/grpc/reflection (from $GOROOT)
        /go/src/google.golang.org/grpc/reflection (from $GOPATH)
config/config.go:16:2: cannot find package "gopkg.in/yaml.v2" in any of:
        /usr/local/go/src/gopkg.in/yaml.v2 (from $GOROOT)
        /go/src/gopkg.in/yaml.v2 (from $GOPATH)
make: *** [build] Error 1
Makefile:25: recipe for target 'build' failed

What I expected to see
A clean build of the iotex-core

@jerkyrs
Copy link
Contributor Author

jerkyrs commented Jun 4, 2018

It seems as though it thinks these dependencies are already in the working directory, they probably should be pulled in using go get via run commands (bolt, proto, grpc)

RUN go get google.golang.org/grpc

@zjshen14 zjshen14 self-assigned this Jun 4, 2018
@zjshen14
Copy link
Contributor

zjshen14 commented Jun 4, 2018

@jerkyrs thanks for reporting the issue. Before building the docker image. try to do the following in your dev environment:

  1. Download and install glide
  2. Rund glide install

@jerkyrs
Copy link
Contributor Author

jerkyrs commented Jun 4, 2018

@zjshen14 ok this works but i don't like it.. You should not have to install something into your working directory before you run a Dockerfile, Dockerfile assumes you are running on a stateless server without anything more then Docker itself available.

I dont know if this is feasible because i never tested it but why not use glide inside container, i realize this comes with overhead have having to fetch each time but you can not rely on what is currently installed in the users working directory to facilitate a clean build.

RUN curl https://glide.sh/get | sh

@zjshen14
Copy link
Contributor

zjshen14 commented Jun 4, 2018

It's possible to use glide inside container, we didn't do it to shorten the process of building an docker image. This is under the assumption that glide install has been executed so that dependencies will be copied into docker too. However, you have raise a fair point.

@jerkyrs
Copy link
Contributor Author

jerkyrs commented Jun 5, 2018

tested commit e380921 , the CMD syntax for starting iotex-server is incorrect

CMD ["iotex-server", "-stderrthreshold=WARNING", "-log_dir=/var/log/iotex/server.log", "-config=/etc/iotex/config.yaml"]

Available options

usage: server -config=[string]
  -config string
        specify configuration file path (default "./config.yaml")
  -log-level string
        Log level (default "info")
  -log-path string
        Log path

Does not start automatically as a result

@zjshen14
Copy link
Contributor

zjshen14 commented Jun 5, 2018

Good catch! Will fix this

@zjshen14
Copy link
Contributor

zjshen14 commented Jun 8, 2018

This is fixed in the latest master

@zjshen14 zjshen14 closed this as completed Jun 8, 2018
saitofun added a commit that referenced this issue May 30, 2024
…th ws contracts (#4283)


* feat(ioctl/ws): ioctl support ws project device contract interactions

---------

Co-authored-by: CoderZhi <thecoderzhi@gmail.com>
dustinxie pushed a commit that referenced this issue May 30, 2024
…th ws contracts (#4283)


* feat(ioctl/ws): ioctl support ws project device contract interactions

---------

Co-authored-by: CoderZhi <thecoderzhi@gmail.com>
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

2 participants