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.
This commit is contained in:
Will Norris 2022-05-03 11:41:32 -07:00 committed by Brad Fitzpatrick
parent 1302c5aaf1
commit 5bf75895b8
2 changed files with 2 additions and 16 deletions

View File

@ -1,3 +1,4 @@
bin/*
tmp/*
misc/docker/release/*
Dockerfile

View File

@ -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