<build>(docker): refactor our dockerfile according to best practice #51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Do some dockerfile refactor according to official dockerfile_best-practices
The reason why these refactor are essential is that it's risky without locking the version of packages.
Here's what i've done in this PR:
--no-install-recommends
andrm -rf /var/lib/apt/lists/*
is highly recommended in production env to slim the image sizeuse a package manager as
poetry
to lock packages versionremove compiler, git and other redundant tools after
BerryNet ./configure
is doneMove the rest of python dependencies into
poetry.lock
Because we use
func 2>&1 | tee -a $LOG
inconfigure
, docker build would still finish successfully if there's an error happened in./configure
.