-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker improvements #12
Conversation
Also migrated to Docker image python-3.8 slim, which is quite slim.
I have added a branch with my Alpine work, ref: |
I've try the docker image in a few repositories and here here my test notes:
Could be a informative message like:
Later I post comments about the Dockerfile |
My notes on the debian image
In debian based images its a good practice to add --no-install-recommends to avoid download extra-packages. If some of these packages are really necessary they should be explicitly as a depend RUN apt-get update \
&& apt-get install -y --no-install-recommends aspell aspell-en \
&& rm -rf /var/lib/apt/lists/*
Its a good practice to pin the exact version used for each package and its dependences and put on a requirements.txt. This forces the docker image build to aways produce the same result. Today on python:3.8-slim the command backrefs==4.3
beautifulsoup4==4.9.1
bracex==2.0
html5lib==1.0.1
lxml==4.5.1
Markdown==3.2.2
pyspelling==2.6
PyYAML==5.3.1
six==1.15.0
soupsieve==2.0.1
wcmatch==6.0.1
webencodings==0.5.1 |
About Docker alpine1) You can have multiple Dockerfiles
2) In alpine we don't need to updateJust use the --no-cache and the apk will be found download and installed without touching the cache. Ex: 3) Temporary package installationSometimes we just gonna use a package during build or installation (gcc) so there are 2 approachs:
Ex: RUN apt install unzip && unzip myfile.zip && apt uninstall unzip 4) Building wheel for lxml takes a huge amount of time.This doeesn't feel right. i believe it could be some bad config in lxml setup.py. 5) Alpine is so good at making small images. Dont give up!github-action-spellcheck:alpine 106MB |
Hi @edumco Thanks for the elaborate feedback. I have compiled your comments to this list:
|
Added suggested improvements to Dockerfile based on Debian image
…nt to maintain it
Improvements and issues, which will be addressed separately have been migrated to separate issues. Documentation has been updated and things have been slimmed down. Many areas could do with further improvements:
|
Experimented with Alpine without success, some of the XML requirements did not work.