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
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*
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
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)
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. Where is my Data.fs?
● Docker volume labels
$ docker run -v plone-data:/data plone
$ docker volume ls
plone-data
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. 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
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. Extend: Build & Run
$ docker build -t my-plone:5 .
$ docker run my-plone:5