From 5bf75895b898b30ab20a4d387eced22a5dd46533 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Tue, 3 May 2022 11:41:32 -0700 Subject: [PATCH] docker: use .dockerignore to simplify Dockerfile add Dockerfile to .dockerignore, which achieves the same effect of quicker iteration, without having to manually add each separate file and directory to the build image. --- .dockerignore | 1 + Dockerfile | 17 +---------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/.dockerignore b/.dockerignore index e14324810..fbd3ecd54 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ bin/* tmp/* misc/docker/release/* +Dockerfile diff --git a/Dockerfile b/Dockerfile index 65ca4d536..295ddcf56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,22 +18,7 @@ WORKDIR /go/src/perkeep.org COPY go.mod go.sum ./ RUN go mod download -# Add each directory separately, so our context doesn't include the -# Dockerfile itself, to permit quicker iteration with docker's -# caching. -ADD .git /go/src/perkeep.org/.git -add app /go/src/perkeep.org/app -ADD clients /go/src/perkeep.org/clients -ADD cmd /go/src/perkeep.org/cmd -ADD config /go/src/perkeep.org/config -ADD dev /go/src/perkeep.org/dev -ADD doc /go/src/perkeep.org/doc -ADD internal /go/src/perkeep.org/internal -ADD pkg /go/src/perkeep.org/pkg -ADD server /go/src/perkeep.org/server -ADD website /go/src/perkeep.org/website -ADD make.go /go/src/perkeep.org/make.go -ADD VERSION /go/src/perkeep.org/VERSION +COPY . . RUN go run make.go -v