Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5 base Image #2

Open
tybritten opened this issue Jun 20, 2019 · 8 comments
Open

v5 base Image #2

tybritten opened this issue Jun 20, 2019 · 8 comments

Comments

@tybritten
Copy link

Since we're already upgraded to 5.x, I'm looking at revving the docker images we're testing with as well. The go service ones (MR, Courier, Indexer, Archiver) are pretty slim to begin with but the main RP one is still big. I'd like to switch to a multistage build, hopefully for both the base as well as the main rapidpro image.
@smn I don't know much about these geos libs- can we build them and then transfer them to a final image or do we need all the prereqs?

@smn
Copy link
Collaborator

smn commented Jun 20, 2019

I don't really know to be very honest! We can try and find out.
I don't recall offhand which python dependencies require these to be installed. I think @tobiasmcnulty originally put this rapidpro-base-docker thing together.

👍 from me on attempting to switch to a multistage build and just copying the necessary binaries over though.

@tybritten
Copy link
Author

yeah I'm looking at this approach:
https://blog.realkinetic.com/building-minimal-docker-containers-for-python-applications-37d0272c52f3

I'd love to get the final running image under 1GB 😆

@tybritten
Copy link
Author

i'm messing with it right now and if it works, i'll put. a PR in for a v5 folder/dockerfile

@tybritten
Copy link
Author

also these are interesting: https://github.com/OSGeo/gdal/tree/master/gdal/docker

do you know how much/which parts of GDAL/GEOS/etc RP uses?

@tobiasmcnulty
Copy link
Member

also these are interesting: https://github.com/OSGeo/gdal/tree/master/gdal/docker

Those look potentially helpful!

do you know how much/which parts of GDAL/GEOS/etc RP uses?

I don't, sorry. my gut says just go with whatever is needed for Django (don't try to pare it down too much)...

Semi-related, I soured on Alpine after discovering the strftime bug. I updated an old post recently with my current approach for Django-based Dockerfiles:

https://www.caktusgroup.com/blog/2017/03/14/production-ready-dockerfile-your-python-django-app/

@tybritten
Copy link
Author

I like that approach @tobiasmcnulty. What I'm testing now is a combo of that- do the deps/pip installs in a builder stage then just COPY /venv /venv to the run image

@smn
Copy link
Collaborator

smn commented Jul 3, 2019

@tybritten how's v5 + docker working for you ? I've not looked much at these docker builds since v5 was released.

@tybritten
Copy link
Author

not much is different from v4. Images sizes are still bigger than I'd like (over 1.1GB even with using the multistage builds) i really can't seem to figure out exactly how much of those GEOS libs etc are needed so i think we can stick with the v4 base for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants