Improve local Docker build performance by adding a root .dockerignore
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 72/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- docker
- Domain
- build-system
Research direction
Compare the relevant entries in the root .gitignore with the proposed root .dockerignore entries, then inspect cmd/pipecd/Dockerfile and its COPY . . instruction. Run make run/pipecd and verify that local and generated directories are excluded from the Docker build context without changing the final image contents.
Written by the indexing model from the issue text.
Description
Problem
make run/pipecd builds the PipeCD control-plane image with:
COPY . .
but the repository does not have a root .dockerignore.
During local development setup, Docker can send a very large build context. In my local setup after running the documented dependency/setup commands, the Docker build context reached approximately 2.5 GB. Repo-local generated directories such as .dev, .cache, .artifacts, and web/node_modules are included even though they are not needed in the image build context.
Impact
make run/pipecdis slower than necessary for first-time and repeat local builds- Docker daemon disk usage grows unnecessarily
- Makes the contributor setup experience heavier than expected, especially on first run
Suggested Improvement
Add a root .dockerignore (mirroring the relevant entries from .gitignore) to exclude local/generated directories from the build context. Suggested content:
# Version control
.git
# Local dev environment
.dev
.cache
.artifacts
# Go
vendor
# Node / web
node_modules
web/node_modules
web/dist
web/.cache
web/coverage
docs/node_modules
# Helm chart deps
.rendered-manifests
manifests/pipecd/charts
manifests/piped/charts
manifests/site/charts
manifests/helloworld/charts
# Bazel
bazel-bin
bazel-genfiles
bazel-pipecd
bazel-out
bazel-testlogs
# IDE / OS
.idea
.ijwb
.DS_Store
# Terraform
.terraform
This should significantly reduce the Docker build context size and improve the local contributor experience with no change to the final image contents.
References
cmd/pipecd/Dockerfileline 7:COPY . ..gitignorealready lists these dirs;.dockerignoreentries mirror them
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 365
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 84
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pipe-cd/pipecd
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Label scoped RBAC policies are rejected by the role dialog, so roles that use them cannot be edited Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·