I am new to Docker and I’m trying to create an image for a Java, where the code is hosted in GIT repo. So first checkout code from repo and then need to build with ant. This image will run on CentOS6.7 machine.
As I understood there are two ways to do this,
- Use Centos image as base and install java, git, ant and do the rest, but I couldn’t be able to find a good example on how to do this. If you know any please let me know .
- Can I have java, ant, git installed in host machine and create java app docker image from scratch to just checkout repo and build?
And once the image is ready, I need run the docker image, so once app hosted I need to schedule some cron jobs (which will run using above app jar). Please provide some docker image run command for such a requirement.
Any help appreciated, thanks in advance.