Skip to content

moonrhythm/go-scratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-scratch

Base Image for Golang Web Server

Usage

FROM gcr.io/moonrhythm-containers/go-scratch

ADD entrypoint /
EXPOSE 80
ENTRYPOINT ["/entrypoint"]
$ GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o entrypoint -ldflags '-w -s' main.go
$ docker build -t myapp .

CGO

FROM gcr.io/moonrhythm-containers/go-scratch:alpine

ADD entrypoint /
EXPOSE 80
ENTRYPOINT ["/entrypoint"]
$ GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o entrypoint -ldflags '-w -s' main.go
$ docker build -t myapp .