less than 1 minute read

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.

  1. Install Docker
  2. Use my existing Docker setup files
    1. Grab the contents of this GitHub folder to your machine
    2. Change directory to where you saved the above contents
    3. Build the docker files to create images. Run: 
      docker build -t jenkins-data -f Dockerfile-data .
      docker build -t jenkins2 .

       

    4. Run these freshly minted Docker images as a new container:

      docker run --name=jenkins-data jenkins-data
      docker run -p 8080:8080 -p 50000:50000 --name=jenkins-master --volumes-from=jenkins-data -d jenkins2

       

  3. In a browser, log in to your Jenkins instance at http://127.0.0.1:8080
  4. 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.

Related reading: