Why you should use Docker in your development lifecycle.

Image result for DOcker


Docker is a virtualization tool that enables you to set up "containers" for a variety of environments. So for example, if you want to set up CentOS for a component of your project go head and do that with a quick config file. Want to make sure you have Python 3 with all the libraries needed to run a Machine Learning program, that's easily done also.   

The folks at Docker have done an incredible job of making it super easy to not have to worry about the details of setting up the OS, Network, etc... for each container as well. Anyone who used to use VMWare appliances can remember making sure you got the networking and the shared drives right - not to mention any extra drivers you needed to make everything work.

 Typical VM Appliance                                                                Docker Container
Virtual machine stack example                                            Container stack example


I wont get into too many specifics of how to use it, as I am not a top authority on it so Ill defer you to https://docs.docker.com/get-started/#container-diagram for more details. But what I would like to say is that its super easy to get whatever environment you want up fast.


So why is this so awesome and why am I singing it so many praises? Often times a team has a variety of different experiences, skills, and talents but the project is usually dominated by a particular Technology (for good reasons or bad). What Docker does , at least for the development portion is it democratizes what developers can use. And can do so without taking too much time or jeopardizing the project. Think of it more like - "I'll show my boss something new and cool" - if they dont' like it, just throw it away.

For example - on my current project - Java is primary language , which I believe to be a good choice. I also really enjoy Python for scripting and for System Testing. There isn't much Python experience on the team, and so my boss was reluctant to use Python as we don't have all the team members competent in it. So rather then trying to convince him, I set out on my own to just implement it. Within an hour or less I had a fully functioning Python environment and System Test implemented with little effort. He was both surprised and happy to see its effectiveness.

The following script is all you need to get it set up. Run Docker-Compose and boom you have a fully working Python 3 environment. Write your system tests and put it into the docker. Make the docker run part of your build or deployment process and there ya go.


FROM alpine:3.6
RUN apk add --no-cache python3 && \

python3 -m ensurepip && \

rm -r /usr/lib/python*/ensurepip && \

pip3 install --upgrade pip setuptools && \

if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \

if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \

rm -r /root/.cache


Some other developers have expressed interest in writing tests in Go, Lua, Javascript, etc... this allows everyone to be more creative and try different things.


Comments

Popular posts from this blog

LEARN THE DIFFERENCE BETWEEN COMPUTER SCIENCE AND IT

7 AWESOME BENEFITS OF TRAINING IN MIXED MARTIAL ARTS