DNXLabs / docker-serverless-python

Docker image of Python 3 containing NodeJS, NPM and Serverless Framework.
https://modules.dnx.one
MIT License
1 stars 5 forks source link

Enhancement/compact docker image #1

Closed arthurbdiniz closed 4 years ago

arthurbdiniz commented 4 years ago

The main proposal change in this MR is that instead of keeping an ARG at the beginning of the Dockerfile I have created 3 folders with 3 Dockerfiles each pointing to one python version, python:3.6-slim, python:3.7-slim, python:3.8-slim.

I also locked the dependencies from the images to increase stabillity and remove cache to compress it.

apt-get -q -y clean && \
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*

This compressed the image size from 242.37 MB to 171.44 MB

To finish up, I did some changes to Docker Hub building rules to support this new architecture.

Build rules now

image