disney / meteor-base

Base Docker image for use by Meteor apps
Other
262 stars 119 forks source link

Native dependencies dockerfile breaks; distutils removed from Python 3.12 #170

Closed digitalextremist closed 1 month ago

digitalextremist commented 1 month ago

This might be unnecessary to resolve per something I am missing, but being in a hurry and not very interested in python right now, I patched my custom dockerfile to workaround a python3 module problem.

This is an often reported issue all over the place. I adapted a solution to the apk case in meteor-base below.

Problem: https://docs.python.org/3/whatsnew/3.12.html#summary-release-highlights

Removal of distutils causes a fatal error at time of build, with a ton of preamble and postmortem log spam removed:

npm error npm error ModuleNotFoundError: No module named 'distutils'

As temporary/workaround solution add py3-setuptools after python3 here:

https://github.com/disney/meteor-base/blob/66ae62496c7619d8a6d5b4a1675adf3fcbce7d56/example/app-with-native-dependencies.dockerfile#L26

Workaround above is per advice:


I am not confident enough in python oriented under-rug items or how/why this actually matters to recommend as a pull request, but the above is what one would involve if it did in fact matter.

digitalextremist commented 1 month ago

I got a notification with a solution, but it seems removed. It reminded me that I had removed ca-certificates from my earlier stage, and left it in the later stage. I will check if I did not actually create this problem for myself, and perhaps ca-certificates was pulling in dependencies which made distutils or setuptools unnecessary to enumerate there. Not sure why the post was removed but thanks, @mcorbelli ( I believe? )

digitalextremist commented 1 month ago

My self-doubting theory above was incorrect. Original report is still valid.

I just tried to build with ca-certificates in the first stage and it dies without py3-setuptools ... leaving in my comment though, since my Dockerfile is a bit different from both examples. Not enough to post it, but enough to mention This is my entire first-stage apk command:

RUN apk --no-cache add \
    bash \
    g++ \
    make \
    python3 \
    py3-setuptools
GeoffreyBooth commented 1 month ago

The build still works for me. If you’d like to post a PR to improve this part of the Dockerfile, that would be welcome.