<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-recommendsandrm -rf /var/lib/apt/lists/*is highly recommended in production env to slim the image sizeuse a package manager as
poetryto lock packages versionremove compiler, git and other redundant tools after
BerryNet ./configureis doneMove the rest of python dependencies into
poetry.lockBecause we use
func 2>&1 | tee -a $LOGinconfigure, docker build would still finish successfully if there's an error happened in./configure.