Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Minimal Golang App

This repo aims to explore how to build minimal runtime for golang application.

The final docker image size is:

docker images | grep goapp
adolphlwq/goapp latest  b2b7723296db    25 seconds ago       2.01MB

Requisites

  • Docker 17.05 or higher
  • CMake

Dockerfile

FROM golang:1.10-alpine as builder
ADD main.go /go/src/goapp/
RUN cd /go/src/goapp/ && \
    CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .

FROM scratch
COPY --from=builder /go/src/goapp/main /
CMD ["/main"]

Reference

About

minimal container for go apps

Topics

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages