-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use cache mounts for pip and apt, heavily reducing network requests when cache is warm. - Remove git as a build-time dependency, other than switching to archive endpoints as was done in 39b4f08, this also requires either setting `KARAPACE_VERSION` as container build arg or building karapace/version.py independently. - Add hadolint pre-commit check for linting Dockerfile. - Move to using Python base images for builder and final stage. This allows omitting installation of some build tools. It also allows moving to a more recent Python version, no longer being bound by what's in distro repositories. Wheel availability of some of our Python dependencies prevents us from moving to 3.11 for now. - Change installation approach to construct a virtualenv in the builder step, and copying it unaltered to the final stage, with dependencies and Karapace itself installed in it. This allows having even fewer layers in the final stage, and is simpler. - Introduces a _much_ stricter .dockerignore, ignoring files by default and explicitly including what's required. This makes sure changes in unrelated files does not evict layer cache. For example, a few files that previously erroneously evicted caches, because everything was included: - .git/* - .mypy_cache/* - container/Dockerfile itself - __pycache__/* - .idea/*
- Loading branch information
1 parent
70957d5
commit 4956b2b
Showing
7 changed files
with
78 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
# Ignoring files that are specific to a given checkout, these change based on | ||
# the user commands and not on the repository history. They are not important | ||
# to determine the state of the repository and would invalidate the cache | ||
# layer. | ||
# | ||
# - .git/logs/HEAD - command history | ||
# - .git/index - binary file for the current index, very important for a | ||
# working repository, not interesting for our image | ||
# | ||
.git/logs/HEAD | ||
.git/index | ||
# Ignore everything by default. Making as few files as possible part of default context | ||
# ensures only relevant changes will evict layer cache. | ||
* | ||
|
||
# Include source directories and files required for building. | ||
!karapace | ||
!requirements/*.txt | ||
!setup.py | ||
!version.py | ||
!README.rst | ||
!container/start.sh | ||
!container/healthcheck.py | ||
|
||
# Ignore some files in source directories. | ||
**/.DS_Store | ||
**/Thumbs.db | ||
**/*.pyc | ||
**/*.pyo | ||
**/__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters