Abstract
Using Docker to Build Code
When you have been working for a long time on a codebase, you don’t tend to test if your code can be compiled on other machines. Most of the time, it means that it won’t. But when you have Docker on your side, your dispair would be a one short docker command line deep.
Using Docker to build your code is so easy even your friend will think you are cool when you tell them about it. The most amazing thing that you don’t even need to write any Docker images, there are so many ready-to-go buildpack containers out there you can easily pick up something that you need.
Here is an example of a container we use to do pipeline build and its very suitable for compiling your project on your local desktop. This container is a Centos 7 Jave Build Pack which means that it comes preconfigured with a majority of tools that are needed to compile our projects.
This container comes with Jave, NPM and RVM, and you can take a look at the contents of the dockerfile.
In power Shell:
docker run -it -v ${PWD}:/build/source -v ${HOME}/.m2:/build/.m2 --net=host aemdesign/centos-java-buildpack /bin/bash --login
In Bash:
docker run -it -v `pwd`:/build/source -v ${HOME}/.m2:/build/.m2 --net=host aemdesign/centos-java-buildpack /bin/bash --login
L
Read Full Blog
Q&A
Please use this thread to ask the related questions.
Kautuk Sahni