Skip to content

Commit

Permalink
feat: lightweight docker image based on go 1.10 on alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
tomplus committed Nov 23, 2018
1 parent 34d8d93 commit 5f562d7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
FROM golang:1.8
FROM golang:1.10-alpine

RUN apk add --no-cache git

WORKDIR /go/src/airly-exporter
COPY . .
COPY *.go /go/src/airly-exporter/

RUN go get -d -v ./...
RUN go install -v ./...

FROM alpine

RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*

WORKDIR /go/bin/
COPY --from=0 /go/bin/airly-exporter /go/bin/airly-exporter

EXPOSE 8080

# nobody
USER 65534

CMD ["airly-exporter"]
CMD ["./airly-exporter"]

0 comments on commit 5f562d7

Please sign in to comment.