Skip to content

Add .dockerignore file to exclude build artifacts.#10

Open
nachomata wants to merge 1 commit intonokia:mainfrom
nachomata:improvement/add-dockerignore
Open

Add .dockerignore file to exclude build artifacts.#10
nachomata wants to merge 1 commit intonokia:mainfrom
nachomata:improvement/add-dockerignore

Conversation

@nachomata
Copy link
Copy Markdown
Contributor

This pull request adds a .dockerignore file to reduce the build context size and speed up the build process with Docker.

When building the Corteca CLI using Docker, it may take some extra time transferring the build context to the Docker daemon - especially due to the size of the dist directory with the build artifacts.

Performance comparison (personal scenario):

OS Before After
Windows ~30s to load build context (158.8 MB) + ~6s for COPY . . ~0.4s to load build context (14 KB) + ~0.6s for COPY . .
Linux (WSL) ~9s to load build context (166.51 MB) + ~12s for COPY . . ~0.5s to load build context (9.85 KB) + ~0.2s for COPY . .

I realize there may be additional files or directories that could also be added to the .dockerignore list. But to keep it simple and easy to review I only added the entries from the .gitignore, with primary focus on excluding the dist folder, as it is the largest contributor to the build context size.

Feedback is welcome!

@tsopokis tsopokis requested review from aegagros and tsopokis April 15, 2025 16:23
Copy link
Copy Markdown
Collaborator

@tsopokis tsopokis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants