using docker multi staging
is there any approach towards using multi staging as docker supports?
as far as i understand the concept, it would be possilbe to split the created images into
- 1st stage: a basic python (with zc.buildout and setuptools installed based on requirements.txt)
- 2nd stage: a basic plone buildout (basic system packages and all the default eggs)
- 3rd stage: a custom plone buildout (extended system packages and additional eggs)
- 4th stage: the running instance (system build deps removed)
and for zeo purpose separate stages using the basic python stage:
- 2nd stage: a basic zeo buildout (basic system packages and all the default eggs only needed for zeo)
- 3rd stage: the running zeo (system build deps removed)
i see some advantages here:
- faster docker builds, as previous unchanged stages will not compile over and over again
- each stage can handle its own entrypoints and commands
- while the basic plone buildout hat entrypoint "buildout" and CMD could be "-vvv" or such, the running instance has ENTRYPOINT "./bin/instance" and CMD "start"
- the docker-initialize.py and entrypoint.sh would be gone
- switching inside the docker what might happen could be achieved more explicit
- customising the docker image you want to build might become more handy
- in docker-compose you can select a stage you want to use "target"
as i don't see disadvantages i am ... in doubt ;)
any comments on that? anybody already tried but failed horribly? any concerns?
please share your thoughts.
thanks
@iham
As I have almost no experience with multi staging builds, don't fully rely on my opinion, but I tend to like your proposal.
I also think that this will work best when we will use pip to install Plone #89
I think we also had an earlier discussion about moving to build stages within #90, but nothing materialized.
Thus, I would love to see a pull-request on this and/or some working examples.
thanks for pointing out @avoinea