Skip to content

Instantly share code, notes, and snippets.

@SolarisYan
Forked from PurpleBooth/Dockerfile
Created November 1, 2018 00:53
Show Gist options
  • Select an option

  • Save SolarisYan/8fe7359e94c34142d26e86692931d0e1 to your computer and use it in GitHub Desktop.

Select an option

Save SolarisYan/8fe7359e94c34142d26e86692931d0e1 to your computer and use it in GitHub Desktop.

Revisions

  1. @PurpleBooth PurpleBooth created this gist Sep 14, 2017.
    10 changes: 10 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    FROM golang:1.9

    RUN mkdir -p /go/src/github.com/purplebooth/example
    WORKDIR /go/src/github.com/purplebooth/example
    COPY . .
    RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go

    FROM scratch
    COPY --from=0 /go/src/github.com/purplebooth/example/main /main
    CMD ["/main"]