From b4736c46685ab5c7c5c3d11b9b5a5fc31495057a Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Thu, 19 Oct 2023 10:18:24 -0700 Subject: [PATCH] Update Dockerfile (#395) * Use golang:1.21.3-bullseye as base build image * Remove TARGETARCH arg from Dockerfile --- Dockerfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f2a1b92fd..3b11bf39b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,14 @@ -FROM debian:12 as builder -ARG TARGETARCH -RUN apt-get update && apt-get install -y curl clang gcc llvm make libbpf-dev -y -RUN curl -LO https://go.dev/dl/go1.20.linux-${TARGETARCH}.tar.gz && tar -C /usr/local -xzf go*.linux-${TARGETARCH}.tar.gz -ENV PATH="/usr/local/go/bin:${PATH}" +FROM golang:1.21.3-bullseye as builder + WORKDIR /app + +RUN apt-get update && apt-get install -y curl clang gcc llvm make libbpf-dev + +# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading +# them in subsequent builds if they change +COPY go.mod go.sum ./ +RUN go mod download && go mod verify + COPY . . RUN make build