Skip to content

Instantly share code, notes, and snippets.

@jorlugaqui
Created January 11, 2020 00:19
Show Gist options
  • Save jorlugaqui/221d22fc7629589f330337928b048e53 to your computer and use it in GitHub Desktop.
Save jorlugaqui/221d22fc7629589f330337928b048e53 to your computer and use it in GitHub Desktop.
ahm-docker-initial
### Certs
FROM alpine:latest as certs
RUN apk --update add ca-certificates
### Base
FROM golang:1.12.14-alpine3.10 as base
ENV CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64
COPY . /go/src/ahm/
WORKDIR /go/src/ahm/
# it will take the flags from the environment
RUN go build cmd/main.go
RUN ls -la
### App
FROM scratch as app
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=base /go/src/ahm/main /
ENTRYPOINT ["/main"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment