Skip to content

Commit

Permalink
Enable Dockerfile to build for other archs and OSes.
Browse files Browse the repository at this point in the history
Signed-off-by: Muvaffak Onus <[email protected]>
  • Loading branch information
muvaf committed Dec 7, 2020
1 parent cc4a731 commit 607321a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM golang:1.12-alpine AS builder
ADD . /src
RUN apk add --no-cache git
FROM golang:1.12 as builder

ARG GOARCH=amd64
ARG GOOS=linux

COPY . /src
WORKDIR /src
RUN go build main.go
RUN GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=0 go build main.go

FROM alpine:latest
FROM alpine:3.12.1
COPY --from=builder /src/main /tplink-plug-exporter
EXPOSE 9233
ENTRYPOINT ["/tplink-plug-exporter"]

0 comments on commit 607321a

Please sign in to comment.