Sign inSign up

mandrean/shrink-go

By mandrean

•Updated about 9 years ago

Compiles, strips and compresses statically linked Go binaries into their smallest possible size.

Image
1

225

mandrean/shrink-go repository overview

⁠mandrean/shrink-go

Compiles, strips and compresses statically linked Go binaries into their smallest possible size.

Typically let's you save around 70-80 % in file size.

Based on go1.9 and Alpine 3.6.

⁠Pre-requisites

⁠Usage

Send your Go project import path as the only argument to the build container, and mount your GOPATH or Go project into it:

docker run --rm -it \
	-v $(GOPATH):/go \
	mandrean/shrink-go \
	github.com/your-name/your-project

Or just the Go project it self:

PROJ=github.com/your-name/your-project && \
docker run --rm -it \
	-v ~/go/src/$PROJ:/go/src/$PROJ \
	mandrean/shrink-go \
	$PROJ

The compressed binary will be outputted next to the compiled & stripped one in the same folder.

⁠Maintainers

Tag summary

Content type

Image

Digest

Size

90.4 MB

Last updated

about 9 years ago

docker pull mandrean/shrink-go