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

Reduce docker image size #12

Merged
merged 1 commit into from
Dec 9, 2015
Merged

Conversation

aledbf
Copy link
Contributor

@aledbf aledbf commented Dec 9, 2015

using scratch as base image and compiling gorb binary as a static binary using godep

kobolog/gorb        0.0                 cab748ec88a0        23 minutes ago      6.218 MB
kobolog/gorb        latest              95feb864e584        8 days ago          722.8 MB

@codecov-io
Copy link

Current coverage is 98.16%

Merging #12 into master will not affect coverage as of f62d548

@@            master     #12   diff @@
======================================
  Files           13      13       
  Stmts          218     218       
  Branches        34      34       
  Methods          0       0       
======================================
  Hit            214     214       
  Partial          1       1       
  Missed           3       3       

Review entire Coverage Diff as of f62d548

Powered by Codecov. Updated on successful CI builds.

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
Copy link
Owner

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.

Copy link
Contributor Author

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

Copy link
Owner

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.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


Reply to this email directly or view it on GitHub
https://github.com/kobolog/gorb/pull/12/files#r47049124.

kobolog pushed a commit that referenced this pull request Dec 9, 2015
@kobolog kobolog merged commit 3fc7b40 into kobolog:master Dec 9, 2015
@kobolog
Copy link
Owner

kobolog commented Dec 9, 2015

Thanks!

@aledbf aledbf deleted the reduce-image-size branch December 9, 2015 04:09
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

Successfully merging this pull request may close these issues.

3 participants