-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Enable use in addons #137
Enable use in addons #137
Conversation
@rodfersou I think you can already do that like: docker-compose.yml version: "2"
services:
plone:
image: plone:5
ports:
- "8080:8080"
environment:
ADDONS=my.addon
DEVELOP=src/my.addon
volumes:
- ./:/plone/instance/src/my.addon
command:
- fg See https://github.com/plone/plone.docker/blob/master/docs/usage/addons.rst#add-ons |
@@ -22,7 +22,7 @@ RUN useradd --system -m -d /plone -U -u 500 plone \ | |||
COPY buildout.cfg /plone/instance/ | |||
|
|||
RUN buildDeps="dpkg-dev gcc libbz2-dev libc6-dev libffi-dev libjpeg62-turbo-dev libopenjp2-7-dev libpcre3-dev libssl-dev libtiff5-dev libxml2-dev libxslt1-dev wget zlib1g-dev" \ | |||
&& runDeps="gosu libjpeg62 libopenjp2-7 libtiff5 libxml2 libxslt1.1 lynx netcat poppler-utils rsync wv" \ | |||
&& runDeps="gosu libjpeg62 libopenjp2-7 libtiff5 libxml2 libxslt1.1 lynx make netcat poppler-utils rsync wv" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We intentionally removed gcc/make from this image in order to make it more lighter and secure.
99% of the cases you shouldn't need to build libraries from source code within container. For the remaining of 1% we encourage people to create custom Docker images based on this one and do the compilation at the image level.
&& mkdir /plone/.buildout \ | ||
&& echo "[buildout]" > /plone/.buildout/default.cfg \ | ||
&& echo "download-cache = /plone/buildout-cache/downloads" >> /plone/.buildout/default.cfg \ | ||
&& echo "eggs-directory = /plone/buildout-cache/eggs" >> /plone/.buildout/default.cfg \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be needed as it's the default place where downloads
and eggs
are stored.
@avoinea understand, thanks for the explanation. by the way, the docker-compose suggestion didn't work (I fixed some indentation to actually run): version: '2'
services:
plone:
image: plone:5.2.1
ports:
- '8080:8080'
environment:
- ADDONS=collective.taxonomy
- DEVELOP=src/collective.taxonomy
volumes:
- .:/plone/instance/src/collective.taxonomy
command:
- fg And this was the error I got: $ docker-compose up
Creating network "collectivetaxonomy_default" with the default driver
Creating collectivetaxonomy_plone_1 ... done
Attaching to collectivetaxonomy_plone_1
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/include/python3.7m': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/shutil.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/tempfile.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/lib-dynload': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/encodings': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/_dummy_thread.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/copyreg.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/rlcompleter.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/token.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/base64.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/sre_constants.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/weakref.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/bisect.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/heapq.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/functools.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/hashlib.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/fnmatch.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/warnings.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/codecs.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/_weakrefset.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/io.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/operator.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/os.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/copy.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/genericpath.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/linecache.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/types.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/random.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/keyword.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/reprlib.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/readline.so': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/posixpath.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/stat.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/config-3.7m-darwin': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/sre_compile.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/locale.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/_collections_abc.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/__future__.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/enum.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/hmac.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/tarfile.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/importlib': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/LICENSE.txt': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/collections': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/ntpath.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/tokenize.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/imp.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/re.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/struct.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/sre_parse.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/abc.py': No such file or directory
plone_1 | chown: cannot dereference '/plone/instance/src/collective.taxonomy/lib/python3.7/_bootlocale.py': No such file or directory
collectivetaxonomy_plone_1 exited with code 1 I'll probably look for a custom image in my next try! thanks |
It will work on a fresh clone. In your case it didn't work because you also ran the buildout inside that egg and within docker container it's trying to resolve some symlinks from |
understand |
@avoinea I still think would be better if this package have all we need as environment (tools and cache) to build and start a Plone instance, not to include Plone itself inside. My workflow would be to mount my directory and say "hey docker, build this package for me" then "hey docker, start my instance". That's why I think it is necessary to add Do you think we can get a midterm between those two worlds? Where we use today those docker images? |
@rodfersou I see. I'll take it into consideration for 5.2.2 release 😉 |
IMHO this not really, cool :) Adding more and more stuff make the images bigger, slower to build, pull and add more security concerns. If you want something like that, than IMHO you/the community could/should switch to multi stage build images, with that you can have a minimal one and use that to build an extend one on top of that. One other important point to consider, the current images may already used by people in prod (even if we do not advice that) by adding now suddenly compilers and other things you could compromise their flow/pipline/setup. So that means you should build and tag them different anyway 😄 |
Yes, we can consider it for the next release. I don't think that having a About having debian
alpine
It has not that much impact on the image size (not sure about security, though), and the benefit is that you will be able to easily run complex commands from a Makefile like:
|
For me it is also thinking "long term" now we may add That is why I suggest moving to multi stage and creating a "fat" and a "slim" version. Also, if people really want to add more packages/functions they can always use the "official" image as base for building their own one. :) What I am trying to say is, I want to avoid opening a can of worms, here. As more people start using the images more people want to have more "default included things" because that is what they need/want for their use case :) |
😄 Then we can go for multi stage/multi tags. Now that Python2 is gone, we have space to explore more tags, like for example:
|
@svx I think we underestimate the use of Docker, it is meant to have same execution environment for development, CI, staging and production, but the way it is now it just can't fit in the buildout we use today. For addon development, what I act more today, from time to time we suffer trying to reproduce the same enviroment from Travis or Jenkins, because locally it just works, but tests don't pass. Make is being used more and more for addons at the community, so it is worth to have it in Docker. My target here is to don't need anymore to install a server or development environment from ground up, just use the Docker image. I do care about keep it small (for me the default buildout should not be inside the image, we can just clone outside and run). But of course, if those small changes are not good for the official image I'll go to create a new unofficial one 😄 |
@avoinea I could make a setup based on current image collective/collective.taxonomy#102 in this case I need to install also virtualenv next step would be to try to use docker on travis I think. |
@rodfersou As I see you already fixed your issue directly in collective.taxonomy I'll close this and skip it for now. |
although it was not a good fix 😂 |
The idea is to have a
docker-compose.yml
file in one addon like this:And run
buildout
andinstance fg
from this image using the already present cache