-
Notifications
You must be signed in to change notification settings - Fork 82
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
Reduce docker image size #12
Conversation
Current coverage is
|
PREFIX = kobolog/gorb | ||
|
||
binary: main.go | ||
CGO_ENABLED=0 GOOS=linux godep go build -a -installsuffix cgo -ldflags '-w' -o docker/gorb ./main.go ./http.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why -installsuffix cgo
? Also, I think it will build just fine without listing the source files in the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why -installsuffix cgo
Removed.
Also, I think it will build just fine without listing the source files in the end.
Without ./http.go I see this error
old-mbp:gorb aledbf$ make
CGO_ENABLED=0 GOOS=linux godep go build -a -ldflags '-w' -o docker/gorb ./main.go
# command-line-arguments
./main.go:74: undefined: serviceCreateHandler
./main.go:75: undefined: backendCreateHandler
./main.go:76: undefined: backendUpdateHandler
./main.go:77: undefined: serviceRemoveHandler
./main.go:78: undefined: backendRemoveHandler
./main.go:79: undefined: serviceStatusHandler
./main.go:80: undefined: backendStatusHandler
godep: go exit status 2
make: *** [binary] Error 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you remove both ./main.go
and ./http.go
then it will just compile
the whole package (but not gorb-docker-link
, since it's another main
package).
On Tue, Dec 8, 2015 at 10:59 PM, Manuel Alejandro de Brito Fontes <
notifications@github.com> wrote:
In Makefile #12 (comment)
:@@ -0,0 +1,17 @@
+all: push
+
+# 0.0 shouldn't clobber any release builds
+TAG = 0.0
+PREFIX = kobolog/gorb
+
+binary: main.go
- CGO_ENABLED=0 GOOS=linux godep go build -a -installsuffix cgo -ldflags '-w' -o docker/gorb ./main.go ./http.go
Why -installsuffix cgo
Removed.
Also, I think it will build just fine without listing the source files in
the end.Without ./http.go I see this error
old-mbp:gorb aledbf$ make
CGO_ENABLED=0 GOOS=linux godep go build -a -ldflags '-w' -o docker/gorb ./main.gocommand-line-arguments
./main.go:74: undefined: serviceCreateHandler
./main.go:75: undefined: backendCreateHandler
./main.go:76: undefined: backendUpdateHandler
./main.go:77: undefined: serviceRemoveHandler
./main.go:78: undefined: backendRemoveHandler
./main.go:79: undefined: serviceStatusHandler
./main.go:80: undefined: backendStatusHandler
godep: go exit status 2
make: *** [binary] Error 1—
Reply to this email directly or view it on GitHub
https://github.com/kobolog/gorb/pull/12/files#r47049124.
52c47d2
to
4fc3edc
Compare
4fc3edc
to
9bc32ec
Compare
Thanks! |
using scratch as base image and compiling gorb binary as a static binary using godep