grim/wasdead

Add a multistage docker file for the build
draft
2019-04-06, Gary Kramlich
5e2c17cef003
Parents 201028944eba
Children c5d0072277e8
Add a multistage docker file for the build
  • +13 -0
    Dockerfile
  • --- /dev/null Thu Jan 01 00:00:00 1970 +0000
    +++ b/Dockerfile Sat Apr 06 02:29:24 2019 -0500
    @@ -0,0 +1,13 @@
    +FROM golang:1.12 AS build
    +
    +COPY . /nowdead
    +
    +WORKDIR /nowdead
    +
    +RUN CGO_ENABLED=0 go build -ldflags '-w -extldflags "-static"'
    +
    +FROM scratch
    +
    +COPY --from=build /nowdead/nowdead /nowdead
    +
    +CMD ["/nowdead"]