For an reference example, I had to set up Jenkins to build my Android app. Though I’m using a Mac, once Docker is involved, I can also use the exact same steps on my Windows machine too, and so can you.
- Install Docker
- Use my existing Docker setup files
- Grab the contents of this GitHub folder to your machine
- Change directory to where you saved the above contents
- Build the docker files to create images. Run:
12docker build -t jenkins-data -f Dockerfile-data .docker build -t jenkins2 .
- Run these freshly minted Docker images as a new container:
12docker run --name=jenkins-data jenkins-datadocker run -p 8080:8080 -p 50000:50000 --name=jenkins-master --volumes-from=jenkins-data -d jenkins2
- In a browser, log in to your Jenkins instance at http://127.0.0.1:8080
- Complete the initial Jenkins setup by walking through the on-screen prompts
Much thanks to Sha who wrote this article that quickly highlights the steps for getting Jenkins 2.0 running on Docker. All I added to my Dockerfile was steps to install the Android SDK so that Jenkins can build my app.