[Cubicweb] cubicweb on docker
philippe.pepiot at logilab.fr
Wed May 22 14:58:17 CEST 2019
I've made some significant progress about running cubicweb applications
on docker. I already had a working set of Dockerfiles, configuration and
some scripts which can be copied/adapted to any project but it was still
quite complex to use.
Then I learned about an amazing dockerfile instruction, ONBUILD: https://docs.docker.com/engine/reference/builder/#onbuild
So, from my configuration files and scripts, I started a new project called
"docker-cubicweb" providing useful base docker images suitable for any
project using cubicweb.
Source are in https://hg.logilab.org/master/docker-cubicweb
README in https://hg.logilab.org/master/docker-cubicweb
This build a set of docker images based on this matrix:
* python 2.7 (stretch, buster), 3.5 (stretch) or 3.7 (buster)
* cubicweb 3.25, 3.26 or dev (latest public changeset)
* onbuild variants
We can now share docker configuration across multiple project, make the
build faster, and quickly test applications with various python or
cubicweb versions (including public head).
Image are currently being pushed to our private registry and we have CI
that trigger a rebuild in case of outdated dependencies, debian security
updates or new pypi releases.
What do you think about pushing theses images to the official docker hub
under the logilab namespace ?
Also building this made me think about change we could do in cubicweb to
make things easier:
* Allow cubicweb-ctl commands to take the instance name from an environment variable CW_INSTANCE (the one we use for pyramid wsgi). So we could just run "cubicweb-ctl shell", "cubicweb-ctl upgrade" here.
* Images including cubicweb are about ~300MB, this is mostly due to the
dependency on "dot" utility from the graphviz package which pull a lot
of packages. This is used to display graphs in /schema, I wonder if we
could use something else here ?
More information about the Cubicweb