Skip to content

Instantly share code, notes, and snippets.

@WyriHaximus
Created March 29, 2020 12:59
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 WyriHaximus/512c8bf6cfcc038f09961d0d368eef43 to your computer and use it in GitHub Desktop.
Save WyriHaximus/512c8bf6cfcc038f09961d0d368eef43 to your computer and use it in GitHub Desktop.
FROM golang:1.13-alpine3.11 AS build
RUN mkdir /opt/app
WORKDIR /opt/app
COPY dsmrp1.go /opt/app
# hadolint ignore=DL3018,DL3019
RUN apk add git gcc musl-dev godep
ENV GOBIN /go/bin
ENV GO111MODULE on
WORKDIR /go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-w' -o /dsmrp1 /opt/app/dsmrp1.go
### App
FROM scratch AS app
COPY --from=build /dsmrp1 /dsmrp1
ENTRYPOINT ["/dsmrp1"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment