The Docker Way To Development
Written by Ian Elliot   
Monday, 29 September 2014

Docker is the new way to distribute apps and entire systems in the cloud, on VMs and physical hardware. Now you can set up a development environment with a single command courtesy of a set of new Docker containers.


dockericon

 

Docker is a container system that allows you to package up software so that it has all its dependencies and an isolated operating environment. A Docker container can be installed in an existing system with a single command and it operates in isolation as a self contained sub-system. The advantages are that installation is trivial and there is no chance of interactions causing the whole thing to fail. It gives you all the advantages of distributing software in its own VM but without the waste of duplicated resources. 

Now you can bring the simplicity of containers to your software development. Docker Hub has just announced a set of official containers for common language stacks. The containers are in the Docker Hub Registry and they are curated and maintained to keep them up-to-date and safe to use. 

At the moment there are Official Repos for c/c++(gcc), clojure, go, hy, java, node, perl, php, python, rails and plain ruby. There are also different version of each language stack which should help with testing or legacy code. 

To run you code, assuming you have Docker installed, all you have to do is use a single command. For example for Java:

docker run --rm -v "$(pwd)":
 /usr/src/myapp -w
 /usr/src/myapp java:7
 javac Main.java

which adds the current directory and runs the Java compiler to produce myapp.class that can then be run in the same way.

As well as being language environments enabling you to run your code the containers can be used to distribute the code. Each one makes use of the Onbuild instruction which can be used to integrate your code into the container so that you can distribute it as a finish app in a container without having to rebuild the container. This separates the container from your code an makes it very easy to get completely hooked on the Docker way of doing things.

Once you have your application in a container it will run on just about any OS you care to name. Including Windows only here the use of an emulator slightly spoils the deal. 

Docker Hub is also looking for enthusiastic people to create and maintain official repros of any languages missing from the current list. If you are interested in making your favourite language easier to use then read the guidelines for getting started  and Dockerfile best practices to get some idea of what might be involved.

The only negative about the Dockerization of languages and apps is that it might encourage sloppy programming. By being able to encapsulate a working system you don't have to worry that your code is playing nice with standard code and that it is robust against changes in its environment. Of course these are the advantages of Dockerization too!


dockericon

Banner


Crazy Clocks
10/03/2024

It's that time again when the clocks change and  time is of the essence and I indulge my interest in crazy clocks. I am always surprised that there are still new ideas for how to display the time [ ... ]



Generative AI Training For All On Coursera
04/03/2024

Generative AI is on the loose, getting into business and commerce as well as into art, poetry and coding. Already useful, it  will become ever more useful as long as we use it properly. Coursera  [ ... ]


More News

 

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

 

Last Updated ( Monday, 27 October 2014 )