Skip to content

jefferyfry/spring-petclinic-docker-build

Repository files navigation

Spring PetClinic Docker Build Example

This is an example of running Docker builds on CloudBees Core on Kubernetes using agent pod configuration through the Jenkins configuration UI. This example runs a maven build, docker build and pushes the image to docker hub. For an example of how to use agent pod templates see this repo.

Requirements

  • CloudBees Core 1.212.2.1 with Kubernetes Plugin 1.7.1

Setup

  1. In CJOC, go to the top level Jenkins navigation and select the All tab.
  2. Select kubernetes shared cloud.

kubernetes_shared_cloud

  1. Select Configure.

  2. Here you will add a Kubernetes Pod Template and add the containers you need. The Pod Templates are available to all masters. For this project, these values were specified:

pod_template

In some cases docker.sock is in a different location. Use _ADD Environment Variable_ to specify DOCKER_HOST = _path_. Example DOCKER_HOST=unix:///var/vcap/sys/run/docker/docker.sock
  1. Then see the Jenkinsfile for an example pipeline of how these containers are used to do the maven build, docker build and push to the registry.

  2. In this example, DockerHub is used. Add your credentials for DockerHub so that they can be referenced by the pipeline.

credentials

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published