Skip to content

Commit

Permalink
Updated Dockerfile for cross-build.
Browse files Browse the repository at this point in the history
  • Loading branch information
icemarkom committed Nov 14, 2021
1 parent f540ee0 commit 41f7de4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM golang:latest AS pitemp-builder
FROM golang:alpine AS pitemp-builder

# Builder image
WORKDIR /pitemp
COPY . .
RUN go build
RUN GOOS="linux" GOARCH=$(uname -m | sed -e "s/aarch64/arm64/" -e "s/x86_64/amd64/" -e "s/armv7l/arm/") go build

# Final image
FROM debian:stable-slim
RUN apt-get update && apt-get install --yes ca-certificates
FROM alpine:latest
RUN apk --no-cache add ca-certificates
#RUN apt-get update && apt-get install --yes ca-certificates
COPY --from=pitemp-builder /pitemp/pitemp /usr/local/bin/pitemp
ENTRYPOINT ["/usr/local/bin/pitemp"]
CMD ["--help"]

0 comments on commit 41f7de4

Please sign in to comment.