Sign inSign up

blang/golang-alpine

By blang

Updated over 9 years ago

Image
4

5.4K

blang/golang-alpine repository overview

DEPRECATED in favor the official golang image

New golang official images are based on alpine as well.

Alpine linux golang docker image - 204MB

Because alpine linux and therefor gliderlabs/alpine docker containers use musl instead gnu libc, your golang binaries build using libc will not work on alpine. There are two ways you can fix this:

Static linking

CGO_ENABLED=0 go build -a -installsuffix cgo

Use this docker image

Use this docker container to build your golang project for alpine linux.

Image golangImage blang/golang-alpine
~515 MB~281 MB
GCC+Other weightBare

Also check out my blog post about this topic.

Usage

Like the base golang image

docker pull blang/golang-alpine
docker run --rm -v "$PWD":/go/src/github.com/yourname/yourrepo -w /go/src/github.com/yourname/yourrepo blang/golang-alpine go build -v

docker run --rm -v "$PWD":/go/bin blang/golang-alpine go get github.com/yourname/yourrepo

Tag summary

Content type

Image

Digest

sha256:447914b81

Size

78.3 MB

Last updated

over 9 years ago

docker pull blang/golang-alpine