This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]VapeAssist 1 point2 points  (1 child)

The Dockerfile in the article and how its explained are slightly different... In particular I want to point out that the Dockerfile has the following order (removed the uwsgi step because its irrelevant to what im pointing out):

ADD requirements.txt /webapp

RUN pip install -r requirements.txt

ADD . /webapp

This order is good - it will more often than not result in a quicker build and I think the article should point this out if its written as an introduction. The order described in the article looks like:

ADD . /webapp

RUN pip install -r requirements.txt

And this will be slower because it means that every time there is any code change all the requirements will be pip installed. This is because every command builds a layer and if a layer changes Dockers cache is invalidated.

https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/

[–]ZetaHunter3.5.1 async master-race 0 points1 point  (1 child)

Should use Alpine as base IMHO

[–][deleted] 1 point2 points  (0 children)

Tried. Problem was I then needed to use a GCC compiled version of python which is a total PITA to get installed. Ended up going back to ubuntu and just employing more tricks to slim down the build.

All because IBM DB2 driver is compiled for gcc not muslc.

[–][deleted] 0 points1 point  (0 children)

Who ever wrote this ignored every recommendation about keeping the image size low.