Open MikeTheCanuck opened 7 years ago
For PostGIS we probably need the Debian PostgreSQL image - I wasn't able to find Alpine packages for PostGIS in a quick search. But if there's no PostGIS requirement, just PostgreSQL, the Alpine image should work. There's an Alpine-based PostgreSQL image in the "Docker Store". You only need the PostgreSQL client libraries in the Python image.
That said, proliferation of options this late in the project life cycle is probably not a good idea. The more other peoples' stuff we have to test, the less of our own code we can troubleshoot.
Yep, agreed. I'll annotate this as another [Future] idea.
In the backend projects'
Dockerfile
, the first instruction usually saysFROM python:3.4
. For those that don't know, this is telling the Docker engine to start with the official Python docker image, in this case the one that includes Python 3.4.In investigating what it would take to use the latest Python (hint:
FROM python:latest
currently gets us Python 3.6), I also stumbled across the Alpine Linux images (e.g.FROM python:3.4-alpine
).I gave the Budget Team's backend one try (see this Travis build) with the
python:alpine
tag and got the following (not unexpected) error:This implies that the alpine image includes python 3.6 but doesn't include one of {postgresql, postgresql-devel}. And there will likely be other dependencies we take for granted from the standard python images that are stripped out of the alpine image.
Benefit
According to the usage example it could shave up to ~200 MB off the resulting container image, which could make developers happier and might slightly speed up build time. [Storage space in AWS or Docker Hub aren't a concern, assuming they don't charge for the size of the images that get stored there.]
Tradeoff
This could in fact measurably slow down the build time if we end up having to
pip install
more packages. That would also require some sort of pre-install automation e.g. arequirements-docker.txt
that would have to be installed beforerequirements.txt
.Probably not worth it unless storage assumptions change.