Skip to content

Instantly share code, notes, and snippets.

@russau
Created July 12, 2020 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save russau/7f8dab1fc9a08efcc259ce0fc56aa51c to your computer and use it in GitHub Desktop.
Save russau/7f8dab1fc9a08efcc259ce0fc56aa51c to your computer and use it in GitHub Desktop.
Minimal docker container with a multi-stage build
FROM golang:1.14
WORKDIR /go/src/app
COPY . .
RUN go build hello-world.go
FROM scratch
COPY --from=0 /go/src/app/hello-world .
CMD ["./hello-world"]
package main
import "fmt"
func main() {
fmt.Println("hello world")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment