sclorg/golang-container

Build fails for golang-starters/golang-rest-http

Closed this issue · 3 comments

I am trying to build https://github.com/golang-starters/golang-rest-http project using the builder image go-toolset-7-centos7:latest but it fails with the following error.

➜  golang-rest-http git:(master) s2i build -e IMPORT_URL='github.com/golang-starters/golang-rest-http' . centos/go-toolset-7-centos7:latest test-app
/tmp/src ~
~
Assembling GOPATH
Resolving dependencies
~/go/src/github.com/golang-starters/golang-rest-http ~
~
~/go/src/github.com/golang-starters/golang-rest-http ~
Building
mv: target '/opt/app-root/gobinary' is not a directory
Build failed
ERROR: An error occurred: non-zero (13) exit code from go-toolset-custom

@jcajka Any ideas why this might have failed?

Interesting I could get this running

s2i build -e IMPORT_URL='github.com/golang-starters/golang-rest-http' . centos/go-toolset-7-centos7:latest test-app
/tmp/src ~
~
Assembling GOPATH
Resolving dependencies
~/go/src/github.com/golang-starters/golang-rest-http ~
~
~/go/src/github.com/golang-starters/golang-rest-http ~
Building
~
Build completed successfully

and then did a

 docker run -t test-app
{"level":"info","msg":"Running as user name 'default' with UID 1001.","pkg":"main","time":"2018-11-28 19:29:48","username":"default","uuid":"1001"}
{"gid":"0","groupname":"root","level":"info","msg":"Running as as group 'root' with GID 0.","pkg":"main","time":"2018-11-28 19:29:48"}
{"level":"info","msg":"metrics registered successfully","pkg":"metric","time":"2018-11-28 19:29:48"}
{"action":"Show","ctrl":"Status","level":"info","msg":"mount","route":"GET /api/status","time":"2018-11-28 19:29:48"}
{"level":"info","msg":"Git Commit SHA:  0","time":"2018-11-28 19:29:48"}
{"level":"info","msg":"UTC Build Time:  0","time":"2018-11-28 19:29:48"}
{"level":"info","msg":"UTC Start Time:  2018-11-28T19:29:48Z","time":"2018-11-28 19:29:48"}
{"level":"info","msg":"GOMAXPROCS:      4","time":"2018-11-28 19:29:48"}
{"level":"info","msg":"NumCPU:          4","time":"2018-11-28 19:29:48"}

So, we might not really need the dep ?

I tried it again and strangely it worked. I'm closing this issue 😅

So, we might not really need the dep ?

Depends on the project. The go get command worked for golang-rest-http project but doesn't work for all projects (eg: fabric8-auth).