Running python in read-only Docker container Running python in read-only Docker container docker docker

Running python in read-only Docker container


You can start Python with the -Bargument:

python -B myscript.py

This turns off writing .pyc and .pyo files when you import .py files.

Alternatively, you set and environmental variable:

PYTHONDONTWRITEBYTECODE=x