mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-24 17:04:42 +01:00
use COPY instead of ADD, install pkgs then build
- using COPY instead of ADD, since working with local paths, and not extracting archived data - installing packages before building application binary improves caching, and avoids installing packages every time the application code changes Signed-off-by: Anastas Dancha <anapsix@random.io>
This commit is contained in:
parent
108a88ae57
commit
4a84368d24
@ -1,9 +1,9 @@
|
||||
# Build the go application into a binary
|
||||
FROM golang:alpine as builder
|
||||
WORKDIR /app
|
||||
ADD . ./
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -installsuffix cgo -o gatus .
|
||||
RUN apk --update add ca-certificates
|
||||
WORKDIR /app
|
||||
COPY . ./
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -installsuffix cgo -o gatus .
|
||||
|
||||
# Run Tests inside docker image if you don't have a configured go environment
|
||||
#RUN apk update && apk add --virtual build-dependencies build-base gcc
|
||||
|
Loading…
Reference in New Issue
Block a user