Azure / azure-functions-docker

This repo contains the base Docker images for working with azure functions
MIT License
267 stars 118 forks source link

[Python]Remove Windows and OSX folders from Python Language worker folder #416

Open pragnagopa opened 3 years ago

pragnagopa commented 3 years ago

Similar to https://github.com/Azure/azure-functions-host/blob/dev/build/build-extensions.ps1#L103

Delete Python, Powershell and Java workers from Node image .

Compare Node image size before and after this change

pragnagopa commented 3 years ago

Verified that language workers for each image only contain worker for that language!

Python worker includes a folder for Windows. We should clean that up

root@080a7a00c377:/# ls azure-functions-host/workers
python
root@080a7a00c377:/# ls azure-functions-host/workers/python/
3.6  3.7  3.8  3.9  worker.config.json
root@080a7a00c377:/# ls azure-functions-host/workers/python/3.9
LINUX  OSX  WINDOWS
pragnagopa commented 3 years ago

Update https://github.com/Azure/azure-functions-docker/blob/dev/host/3.0/buster/amd64/python/python39/python39-appservice.Dockerfile#L78 to only copy Linux folder

CooperLink commented 3 years ago

I have addressed this on my local branch but, I am still not getting the image sizes reduction that I expected. After removing all versions of the worker other than 3.9 and removing both the Windows and OSx folders, I expected the image to reduce in size by atleast 400 mb. Instead it is about 140mb smaller. Still an improvement. Just not what I was expecting