Alpine makes Python Docker builds slower, and images larger
I do a lot of Python and a lot of Docker. Mostly python in Docker. I&#x27;ve used both Alpine and Ubuntu. There is a fair amount right about this article, and a lot wrong.<p>First &quot;the Dockerfiles in this article are not examples of best practices&quot;<p>Well, that&#x27;s a big mistake. Of course if you don&#x27;t follow best practices you won&#x27;t get the best results. In these examples the author doesn&#x27;t even follow the basic recommendations from the Docker Alpine image page. Ex, use &quot;apk add --no-cache PACKAGE&quot;. When you&#x27;re caching apt &amp; apk, of course the image is going to be a ton larger. On the flip side he does basically exactly that to clean up ubuntus apt cache.<p>The real article should have been &quot;should you use alpine for every python&#x2F;docker project?&quot; and the answer is &quot;No&quot;. If you&#x27;re doing something complicated that requires a lot of system libs, like say machine learning or imagine manipulation - don&#x27;t use Alpine. It&#x27;s a pain. On the flip side if all you need is a small flask app, Alpine is a great solution.<p>Also, build times and sizes don&#x27;t matter too much in the grand scheme of things. Unless you&#x27;re changing the Dockerfile regularly, it won&#x27;t matter. Why? Because Docker caches each layer of the build. So if all you do is add your app code (which changes, and is added at the end of the Dockerfile) - sure the initial build might be 10 mn, but after that it&#x27;ll be a few seconds.  Docker pull caches just the same, so the initial pull might be large, but then after that it&#x27;s just the new layers.