Playing with Docker and Sparrow
Docker is quite popular solution to rapidly spin up developers environments. I have been playing with it and it seems fun for me. The other fun thing I found that Sparrow could be a good solution to build up new docker images.
Here is short example of how it could be. A few lines in Dockerfile and you have a GitPrep server up and running as docker container. Whew!
Here is my Dockerfile:
FROM perl:5.20
RUN apt-get update
RUN apt-get install sudo
RUN apt-get install git-core
RUN cpanm Sparrow
RUN sparrow index update
RUN sparrow index summary
RUN sparrow plg install gitprep
RUN sparrow plg run gitprep
CMD sparrow plg run gitprep --param action=start --param start_mode=foreground
I base on official perl docker image and then let all the job to be done by sparrow gitprep plugin!
This is how one can use it:
$ git clone https://github.com/melezhik/docker-projects.git
$ cd docker-projects/gitprep
Build an image with target melezhik/gitprep or whatever you want. You probably will need to run this command more than once if meet "Installing the dependencies failed: Installed version (1.636) of DBI is not in range '== 1.634'"
error.
$ sudo docker build -t melezhik/gitprep .
Run gitprep server
$ sudo docker run -p 10020:10020 -d -i melezhik/gitprep
Test it!
curl 127.0.0.1:10020
Thanks to Sebastiaan van Stijn a guy from Docker team, a shorter form of building the image would be:
$ sudo docker build -t melezhik/gitprep https://github.com/melezhik/docker-projects.git#:gitprep
Thanks for creating GitPrep plugin.