Create a Docker Version
Hi,
i looking to create a Docker version of mailpiler, but cause of the "install" it is not as easy as i thought.
Can you support me or create a docker version?
I would prefer to setup a docker-compose setup, with webgui, piler, clam and mysql.
Comments (20)
-
repo owner -
reporter Hello Janos, that sounds greate. Would you like to push your Dockerfile? Or how you do the build process? So I would be able to create a docker-compose.yaml for it and/or all other docker services.
Thank you. Regards, Josef
-
repo owner I'll use Dockerfile and deb package of piler. I'll keep you posted.
-
reporter Okay, thank you. Then I'll try to port it to alpine linux for a smaller overhead.
-
Account Deleted Hello,
i think this is a great idea. I'm using piler on a separate machine (not dockerized) in connection to a dockerized version of a mailserver. So i'm very interested in this developement.
-
repo owner OK, I've just pushed sutoj/piler:latest to docker hub. Consider it as a prototype at the moment, good for trying.
Prerequisites: a working mysql server with the following sql commands:
grant all privileges on piler.* to 'piler' identified by 'piler123'; flush privileges;
Feel free to fix the password in the query above.
Then get the docker image, and run it as follows:
docker run --name piler -d -e PILER_HOSTNAME=archive.yourdomain.com -e MYSQL_HOSTNAME=mysql -e MYSQL_DATABASE=piler -e MYSQL_USERNAME=piler -e MYSQL_PASSWORD=piler123 -p 25:25 -p 80:80 sutoj/piler
Use the same password what you specified just before.
A few things might be improved however: - use https instead of http - use your own piler.key, not the one generated by the deb package Note that you may override it using -v /path/to/piler.key:/etc/piler/piler.key:ro option - specify a volume for /var/piler/store/00 and /var/piler/sphinx directories to provide a persistent storage for the container
So, be sure to try it, and let me know how it works for you.
-
repo owner - changed status to resolved
-
Account Deleted Hi Janos,
i really appreciate your great work and efforts. A long time has passed by since my last post, but work and other projects took much more time as i expected. Now i have some to "spent" and would like to try out a version of dockerized piler. Would you mind sharing you Dockerfile?
Regards Feuernatter
-
repo owner Hello Feuernatter, ok, I'll give it to you. I use two steps to create the docker image. I have a 'stage1' image with all the run time dependencies, ie. libs (libssl, libtre, ...) and applications (eg. mysql, nginx, pdftotext, ...) installed. Then I use this image as a base and deploy the piler deb package to create stage2.
I suggest you to get sutoj/piler:xenial.stage1 from docker hub, and experiment with it. All it needs is to install a deb package, and perhaps customize its config. You may try this one: http://download.mailpiler.org/piler_1.4.1~xenial-6c9b258_amd64.deb
I strongly recommend to use it for testing, since it uses the internal storage for all data (mysql, sphinx, mail files, ...).
With that being said, it suits my tests, perhaps later I'll compile a docker image using external mysql server, and using a mounted (or mapped) filesystem to store emails suitable for production. I'll figure out how to ship and distribute it.
-
repo owner Stage1 dockerfile: https://pastebin.com/x6rGiMDN Stage2 dockerfile: https://pastebin.com/rqwMvnfW
-
Account Deleted Hi Janos,
thank you for sharing yout code. I noticed that you use ubuntu as a base image. Does this fit on a debian machine too?
-
repo owner Yes, it should work with debian as well.
-
Hi Janos,
Could you please post the current docker files for this build. The pastebin post is not live anymore. Also would it be possible to included this docker file in the source.
Thanks
-
repo owner There you have it: https://bitbucket.org/jsuto/piler/src/master/docker/Dockerfile, enjoy!
Note that it has both sphinx and mysql (besides piler). It’s primary purpose is to test it. However, you may fix it to use a volume mount for piler data files, configs, etc. and even tweak it to use a separate image for sphinx and mysql.
-
Hi,
Thank you all the hard work you put into mailpiler but I have an issue when running the Dockerfile. It says:
“Error response from daemon: Dockerfile parse error line 8: unknown instruction: PACKAGE="${PACKAGE}"“
Thanks
Edit: Never mind there was a \ missing in the line before package=”$(PACKAGE)”
-
repo owner PACKAGE is a prebuilt deb package for bionic. You may grab https://bitbucket.org/jsuto/piler/downloads/piler_1.3.7-bionic-94c54a0_amd64.deb and run something like
docker build --build-arg PACKAGE=piler_1.3.7-bionic-94c54a0_amd64.deb piler/piler:1.3.7 .
-
Hi,
thank you for the response the Dockerfile was the issue a \ was missing in the line before package. Now it runs.
EDIT: Also needed to add
RUN chmod +x start.sh
in Dockerfile and rebuild. -
What to do about:
Step 6/10 : ADD start.sh /start.sh
ADD failed: stat /var/lib/docker/tmp/docker-builder374381144/start.sh: no such file or directory
For those less familiar with Docker, you need a folder with both Dockerfile and start.sh from this bitbucket:
https://bitbucket.org/jsuto/piler/src/master/docker/
Then from that folder, run
docker build --build-arg PACKAGE=piler_1.3.7-bionic-94c54a0_amd64.deb .
The dot represents the current folder.
-
hi Janos,
I know this is an old thread but didn’t want to create an issue as this is not an issue per se, I was wondering if you’d be ok with uploading the Dockerfile for the piler-1.3.12 image on Dockerhub ?
-
repo owner The latest version is already there: sutoj/piler:1.4.1
- Log in to comment
Hello, a docker image is quite possible, I use it even for myself running tests, etc. However, I don't use docker-compose, since everything is in a single container.
This setup may not be good enough for production use, so I think it's better to use a remote mysql server, and let the user decide whether the mysql server is on another container or in a virtual machine, whatever. How about that?