Looking at Liferay 7 Milestone 7 download stats, it seams many have tried it already. Yet considering the size of the community, the numbers are not that impressive. I'm pretty sure it's not because it's too hard or too time consuming to do it. However if that was your excuse, you may need to think of another one because trying out Liferay just got easier. How much easier? As easy as typing
./liferayctl start in your command prompt!
If you are Linux or OS X user, please allow me to introduce to you liferayctl - a command line tool to download and run a Liferay version from a Docker container.
Obviously you need to have Docker installed before you can use it (if you still don't, I really admire your resistance to IT trends)!
Let me give you some examples:
Before we start, let's get the tool and make it executable
curl -LO http://tiny.cc/liferayctl && chmod +x liferayctl
Now lets run Liferay 7 Milestone 7 (attention OS X users, make sure you are in a
boot2docker terminal window)
./liferayctl -v 7.0m7 start
Be patient - it needs to download the image the first time you start it. This may take few minutes. Once it starts go to
http://localhost:8080 and enjoy it ;)
Now let's say you want to compare it to the latest stable release (6.2ga4 at the time of writing), side by side in your browser. Type
./liferayctl -p 8180 -a 8109 start
and point you browser to
http://localhost:8180. Feel free to add and modify whatever you want. Once you are done playing with it, simply run
./liferayctl -v 7.0m7 stop
to stop both instances. You can start it again later on by repeating the steps above.
As you see, you don't have to be a Docker expert to use
liferayctl. However it helps to get to know how it works!
Liferay Docker images
Now that you know liferayctl starts Liferay from a Docker container, you may wander which images it uses. If you search for Liferay in Docker Hub you'll find quite some images. Those vary widely in size, configuration and what Liferay version they target.
As much as I hate to reinvent the wheel, I had to create own images to satisfy the following requirements:
- have minimal size images (based on Apline Linux image)
- have minimal layers (single layer above Alpine providing all the data and several layers with meta data only)
- make sure images do not depend nor contain anything but Java and Liferay Tomcat bundle
- image structure is the same for each Liferay version (here is how they are generated)
- hove control over
latest tags and make sure they point to the latest stable release and latest milestone release respectively
The images are uploaded in azzazzel/liferay-standalone Docker Hub repository. Sticking to those allows liferayctl to make some assumptions and provide very simple command line interface. However those are regular docker images and can be used directly with Docker. For example there is nothing that prevents you from running
docker run -ti --rm azzazzel/liferay-standalone:7.0m7
Be aware though that liferayctl makes some assumptions about container names and if you start
liferay-standalone container directly from docker, it may interfere with the containers created by liferayctl!
Disclaimer and feedback request
I hope you'll enjoy liferayctl and the images and find them useful. Please keep in mind they are NOT meant to be used in production!
Please also keep in mind liferayctl as well as the docker images are NOT Liferay official artifacts and thus are NOT officially supported by Liferay. All images are build upon Liferay Community Edition versions.
As of now, there are only 3 images uploaded
- 6.2ga4 (also tagged as stable)
- 7.0m7 (also tagged as latest)
I can release other versions on request. There are currently no plans to release Liferay Enterprise Edition images as far as I know! In the future Liferay may or may not decide to release official and supported tool and images. Meanwhile I will do my best to support those tools (I have plans for some more, such as allowing to use different database, automated creation of dev environment, ....) and images as long as there is interest!
So please, please send feedback, pull requests and report issues at liferay-docker-images project page on GitHub. Of course you can also drop me an e-mail or comment here, but this may take longer for me to notice and react.
Last but not least, you can meet me and discuss those and other subjects face to face at Liferay DEVCON, Liferay Portal Solutions Forum - UK and Liferay Symposium North America.