Install dependencies in a separate step
This commit is contained in:
parent
92f89bb313
commit
0b34f6181f
1 changed files with 8 additions and 2 deletions
10
Dockerfile
10
Dockerfile
|
|
@ -1,8 +1,14 @@
|
|||
FROM golang:alpine AS builder
|
||||
|
||||
RUN apk add build-base
|
||||
COPY . /src
|
||||
RUN cd /src/cmd/WatchYourLAN/ && CGO_ENABLED=0 go build -ldflags='-w -s' -o /WatchYourLAN .
|
||||
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum .
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
WORKDIR /src/cmd/WatchYourLAN
|
||||
RUN CGO_ENABLED=0 go build -ldflags='-w -s' -o /WatchYourLAN .
|
||||
|
||||
|
||||
FROM alpine
|
||||
|
|
|
|||
Loading…
Reference in a new issue