Skip to content

Commit

Permalink
Reduce Docker build context by fixing errors in .dockerignore (#884)
Browse files Browse the repository at this point in the history
## Motivation and Context (Why the change? What's the scenario?)

When building the container image locally after building the Visual
Studio solution, a total of 3.62 GB of data is transferred in the Docker
build context, slowing down the container build duration.

## High level description (Approach, Design)

Fix a mistake in the `.dockerignore` file that results in the `bin` and
`obj` folders being included in the build context.

Ignore the `docs`, `examples`, and `infra` folders as these are not
required to build the service project.

Results in the build context being reduced to 7.6 MB.
  • Loading branch information
alexmg authored Nov 12, 2024
1 parent ad4a996 commit a60ecb8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
.vscode
docker-compose.yml
docker-compose.*.yml
*/bin
*/obj
**/bin
**/obj

# Exclude folders not required for compile
docs
examples
infra

# To make sure that the local appsettings files are not copied when building the image locally.
# These files are not in GitHub thanks to .gitignore
Expand Down

0 comments on commit a60ecb8

Please sign in to comment.