From 3a541195179248b75c17f7aa2fbb27187c9f4ff0 Mon Sep 17 00:00:00 2001 From: jiangpengcheng Date: Tue, 7 May 2024 13:46:35 +0800 Subject: [PATCH] Update Dockerfile --- Dockerfile | 5 ++++- redhat.Dockerfile | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index eab061f5..f5564fa0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ # Build the manager binary FROM golang:1.22.2-bullseye as builder +WORKDIR /workspace/api +COPY api/ . +RUN go mod download + WORKDIR /workspace # Copy the Go Modules manifests COPY go.mod go.mod @@ -11,7 +15,6 @@ RUN go mod download # Copy the go source COPY main.go main.go -COPY api/ api/ COPY pkg/ pkg/ COPY controllers/ controllers/ COPY utils/ utils/ diff --git a/redhat.Dockerfile b/redhat.Dockerfile index 1498f7c3..a010bd51 100644 --- a/redhat.Dockerfile +++ b/redhat.Dockerfile @@ -1,6 +1,10 @@ # Build the manager binary FROM golang:1.22.2-bullseye as builder +WORKDIR /workspace/api +COPY api/ . +RUN go mod download + WORKDIR /workspace # Copy the Go Modules manifests COPY go.mod go.mod @@ -11,7 +15,6 @@ RUN go mod download # Copy the go source COPY main.go main.go -COPY api/ api/ COPY pkg/ pkg/ COPY controllers/ controllers/ COPY utils/ utils/