Faster Python in Docker

Get maximum performance from your containers

Rupert Thomas
Better Programming
Published in
7 min readJan 27, 2020

--

TL;DR: With some simple tweaks to your configuration, you can improve the execution of Python code inside Docker containers to almost native speeds:

  • On an Ubuntu host, the benchmark execution time in Docker was about twice the native time; this difference could be negated by modifying the security settings of the container

--

--

Technology consultant from Cambridge, UK specialising in software engineering, machine learning, machine vision, and building data-driven products