Skip to content

Latest commit

 

History

History
 
 

docker-app

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Create a product Docker image

  • Downloads, from Artifactory, the ‘webservice-1.1.2.war’ file and the ‘docker-framework’ Docker image, that were created in the previous two pipelines
  • Creates a ‘docker-app’ production Docker image
  • Pushes it to Artifactory
  • Scans it with Xray
  • Promotes it to a production repository in Artifactory

Step to create Jenkins Pipeline:

Note: List of required Jenkins plugins

  1. On the Jenkins front page, click on Credentials -> System -> Global credentials -> Add Credentials Add your Artifactory credentials as the type Username with password, with the ID artifactory-credentials Add_Artifactory_Credentials

  2. Create Following Docker repositories in Artifactory. docker-stage-local - Local docker repo. docker-prod-local - Local docker repo. docker-remote - Remote docker repo pointing to Docker hub https://registry-1.docker.io/. bintray-docker-remote - Remote docker repo pointing to Bintray: https://docker.bintray.io. docker - Virtual docker repo aggregating all above created repo with docker-stage-local as default repo for deployment.

  3. Create Generic local repository with name tomcat-local and deploy Java and Tomcat binaries in it.

  4. Create new Jenkins Pipeline Job.

  5. Add String Parameters:

    • ARTDOCKER_REGISTRY (String Parameter) : Domain of Artifactory docker registry e.g ARTDOCKER_REGISTRY : docker.artifactory
    • REPO (String Parameter) -> Artifactory virtual docker registry
      e.g. REPO -> docker
    • PROMOTE_REPO (String Parameter) : Artifactory production docker registry
      e.g. PROMOTE_REPO -> docker-prod-local
    • SOURCE_REPO (String Parameter) : Artifactory staging docker registry
      e.g. SOURCE_REPO -> docker-stage-local
    • SERVER_ID (String Parameter) : Artifactory Server Id
      e.g. SERVER_ID -> artifactory
    • XRAY_SCAN (Choice Parameter) : Xray Scan. Applicable only if you are using JFrog Xray
      e.g. XRAY_SCAN -> YES
    • SERVER_URL (String Parameter) : Artifactory Server URL
      e.g. SERVER_URL -> http://35.225.27.231/artifactory
    • CREDENTIALS (Credentials Parameter) : Artifactory Credential
      e.g. CREDENTIALS -> artifactory-credentials
  6. Copy Jenkinsfile to Pipeline Script.

  7. To build it, press Build Now.

  8. Check your newly published build in build browser of Artifactory.