Is there any disadvantage in using PYTHONDONTWRITEBYTECODE in Docker? Is there any disadvantage in using PYTHONDONTWRITEBYTECODE in Docker? python-3.x python-3.x

Is there any disadvantage in using PYTHONDONTWRITEBYTECODE in Docker?


When you run a single python process in the container, which does not spawn other python processes itself during its lifetime, then there is no "risk" in doing that.

Storing byte code on disk is used to compile python into byte code just upon the first invocation of a program and its dependent libraries to save that step upon the following invocations. In a container the process runs just once, therefore setting this option makes sense.