From 8b8b99c6ae4eb260990face4cd85d52eef3bcff4 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sun, 27 Sep 2020 21:26:06 +0200 Subject: [PATCH] Cache go modules in docker --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d2b1148..a1e0bfa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,10 @@ RUN apk add --no-cache git build-base tcl pkgconfig cmake libressl-dev linux-hea RUN git clone --depth 1 --branch v1.4.2 https://github.com/Haivision/srt && \ cd srt && ./configure --enable-apps=OFF && make install && cd .. && rm -rf srt WORKDIR /code -COPY . . +COPY go.* ./ RUN go mod download -RUN go build -o ./out/ghostream . +COPY . . +RUN go build -ldflags '-extldflags "-static"' -o ./out/ghostream . # Production image FROM alpine:3.12