[v2] refactor Dockerfiles that they can share layers (#1113)

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
This commit is contained in:
Zbynek Roubalik 2020-09-09 23:22:23 +02:00 committed by GitHub
parent 846ddd3f9c
commit 3596eef67d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -2,6 +2,7 @@
FROM golang:1.15 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
@ -10,16 +11,18 @@ COPY go.sum go.sum
RUN go mod download
COPY Makefile Makefile
COPY .git/ .git/
# Copy the go source
COPY hack/ hack/
COPY version/ version/
COPY main.go main.go
COPY adapter/ adapter/
COPY api/ api/
COPY controllers/ controllers/
COPY pkg/ pkg/
COPY .git/ .git/
# Build
RUN make manager

View File

@ -3,8 +3,6 @@ FROM golang:1.15 as builder
WORKDIR /workspace
RUN mkdir -p /apiserver.local.config/certificates && chmod -R 777 /apiserver.local.config
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
@ -13,15 +11,20 @@ COPY go.sum go.sum
RUN go mod download
COPY Makefile Makefile
COPY .git/ .git/
# Copy the go source
COPY hack/ hack/
COPY version/ version/
COPY api/ api/
COPY main.go main.go
COPY adapter/ adapter/
COPY api/ api/
COPY controllers/ controllers/
COPY pkg/ pkg/
COPY .git/ .git/
RUN mkdir -p /apiserver.local.config/certificates && chmod -R 777 /apiserver.local.config
# Build
RUN make adapter