Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

1

Share

Download to read offline

Docker and plone

Download to read offline

From development to continuous deployment.

Related Books

Free with a 30 day trial from Scribd

See all

Docker and plone

  1. 1. From development to continuous deployment. Docker Alin Voinea Eau de Web, Romania Plone &
  2. 2. What is?
  3. 3. What is Docker? Docker is for your system...
  4. 4. What is Docker? ...what virtualenv is for Python
  5. 5. What is Docker? ● Isolated environment ● Same environment (Linux, Mac, Windows...) ● Same environment (Devel, Production) ● Use your favorite Linux distribution ● ...or, build it from scratch
  6. 6. Before Docker
  7. 7. Installing and running Plone without Docker
  8. 8. Plone - w/o Docker Libraries ● libz (dev) ● libjpeg (dev)* ● readline (dev)* ● libexpat (dev) ● libssl or openssl (dev) ● libxml2 >= 2.7.8 (dev)* ● libxslt >= 1.1.26 (dev)* Source:docs.plone.org Python ● Python 2.7 (dev), built with support for expat (xml.parsers.expat), zlib and ssl. ● (Python XML support may be a separate package on some platforms.)* ● virtualenv*
  9. 9. Plone - w/o Docker Minimal build ~/$ mkdir Plone-5 ~/$ cd Plone-5 ~/Plone-5$ virtualenv-2.7 zinstance ~/Plone-5$ cd zinstance ~/Plone-5/zinstance$ bin/pip install zc.buildout ~/Plone-5/zinstance$ echo """ [buildout] extends = http://dist.plone.org/release/5-latest/versions.cfg parts = instance [instance] recipe = plone.recipe.zope2instance user = admin:admin http-address = 8080 eggs = Plone Pillow """ > buildout.cfg Source:docs.plone.org
  10. 10. Plone - w/o Docker This will start a long download and build process ... Errors like "SyntaxError: ("'return' outside function"..."" may be ignored. After it finished you can start Plone in foreground-mode with: $ bin/buildout $ bin/instance fg Source:docs.plone.org
  11. 11. Installing and running Plone with Docker
  12. 12. Plone - w/ Docker $ docker run -p 8080:8080 plone hub.docker.com/_/plone
  13. 13. Plone Add-ons
  14. 14. Plone Add-ons $ docker run -e ADDONS=”eea.facetednavigation collective.easyform” plone
  15. 15. Develop Plone Add-ons $ mkdir src $ cd src $ git clone https://github.com/collective/eea.facetednavigation $ chown -R 500 ../src $ docker run -e ADDONS=”eea.facetednavigation” -e DEVELOP=”src/eea.facetednavigation” -v /host/path/to/src:/plone/instance/src plone fg
  16. 16. Debugging - pdb.set_trace() ● Run Plone from the inside of the container $ docker run -it -e… plone bash $ bin/instance fg . .. ... Zope ready to handle requests ... (pdb)
  17. 17. Storage
  18. 18. Where is my Data.fs? ● Docker volume $ docker run plone $ docker volume ls local f2b18118ef8c5e7c9ef10ef418f27e2a51502220ddecc218c9d28f ● Default location $ ls /var/lib/docker/volumes f2b18118ef8c5e7c9ef10ef418f27e2a51502220ddecc218c9d28f
  19. 19. Where is my Data.fs? ● Docker volume labels $ docker run -v plone-data:/data plone $ docker volume ls plone-data
  20. 20. Where is my Data.fs? ● Unlabeled Docker volumes $ docker run --name my-plone plone $ docker volume ls e2c080c412bc4d33b7d740ca7fee25 ● On remove: $ docker rm -v my-plone $ docker volume ls OMG, WHERE IS MY DATA?
  21. 21. Where is my Data.fs? ● Always LABEL your Docker volumes to avoid data loss $ docker run --name=my-plone -v plone-data:/data plone ● On remove $ docker rm -v my-plone $ docker volume ls plone-data ● Explicitly remove volumes: $ docker volume rm plone-data
  22. 22. ZEO
  23. 23. # zeo client 1 $ docker run --link=zeo -e ZEO_ADDRESS=zeo:8100 plone ZEO Server / ZEO Clients # zeo server $ docker run --name=zeo plone zeoserver # zeo client 1 $ docker run --link=zeo -e ZEO_ADDRESS=zeo:8100 plone
  24. 24. Extend
  25. 25. Extending ● extended_buildout.cfg ● Dockerfile
  26. 26. Extend: extended_buildout.cfg [buildout] eggs += plone.restapi collective.easyform collective.solr eea.facetednavigation
  27. 27. Extend: Dockerfile FROM plone:5.0.6 USER root RUN apt-get install -y ... USER plone COPY extended_buildout.cfg /plone/instance/ RUN bin/buildout -c my_buildout.cfg
  28. 28. Extend: Build & Run $ docker build -t my-plone:5 . $ docker run my-plone:5
  29. 29. Extend: Dockerfile documentation docs.docker.com/engine/reference/builder
  30. 30. Orchestration: Single host $ pip install docker-compose
  31. 31. Docker Compose: Plone & ZEO $ vim docker-compose.yml $ docker-compose up $ docker-compose scale plone=3 version: "2" volumes: plone-data: driver: local services: plone: image: plone environment: - ZEO_ADDRESS=zeo:8100 zeo: image: plone command: zeoserver volumes: - plone-data:/data
  32. 32. Docker Compose: Load balancer $ vim docker-compose.yml $ docker-compose up services: ... load-balancer : image: eeacms/haproxy ports: - 80:5000 - 1936:1936 environment: - BACKENDS=plone - BACKENDS_PORT=8080 - DNS_ENABLED=True
  33. 33. Docker Compose: Demo https://youtu.be/DumoVlrOk4w
  34. 34. Docker Compose: Documentation docs.docker.com/compose
  35. 35. Orchestration: Multiple hosts
  36. 36. Rancher “A Complete Platform for Running Containers”
  37. 37. Rancher: Install & running $ docker run -p 8080:8080 rancher/server
  38. 38. Rancher: Demo https://youtu.be/44zzuAUS-1M
  39. 39. Continuous Deployment
  40. 40. Docs ● hub.docker.com/_/plone ● docs.plone.org (soon) ● docker.com ● rancher.com ● github.com/eea?query=docker
  41. 41. Thanks ● Sven Strack ● Antonio de Marinis ● Eau de Web ● Liana Voinea (my wife)
  • tkimnguyen

    Oct. 26, 2016

From development to continuous deployment.

Views

Total views

2,457

On Slideshare

0

From embeds

0

Number of embeds

1,077

Actions

Downloads

23

Shares

0

Comments

0

Likes

1

×