Skip to content

Commit

Permalink
optimize dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmingtarja committed Mar 13, 2024
1 parent fc074b2 commit f8e9edc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# build hmruntime binary
FROM --platform=$BUILDPLATFORM golang:alpine as builder
WORKDIR /src

# copy go.mod and go.sum files separately so that
# it is only run when the dependencies change
COPY go.mod go.sum ./
RUN go mod download

COPY ./ ./
ARG TARGETOS TARGETARCH
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build .
Expand Down

0 comments on commit f8e9edc

Please sign in to comment.