Skip to content

Instantly share code, notes, and snippets.

@afreerunner
Forked from PurpleBooth/Dockerfile
Created October 10, 2019 01:33
Show Gist options
  • Select an option

  • Save afreerunner/ff7c2bfdd5e4e754cdfeca37a6a8ccd2 to your computer and use it in GitHub Desktop.

Select an option

Save afreerunner/ff7c2bfdd5e4e754cdfeca37a6a8ccd2 to your computer and use it in GitHub Desktop.

Revisions

  1. @PurpleBooth PurpleBooth revised this gist Aug 7, 2019. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,5 @@
    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
  2. @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"]