Skip to content

Sukelluskello/ise-hardened-docker-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ise-hardened-docker-example

This is an example repo of docker image hardening Jenkins Pipeline.

How to setup a new CICD Pipeline for new Docker Image

Step1, Prepare git repo to host jenkins scripts:

  1. Duplicate this GitHub Repo, give it a name like ise-hardened-${your-docker-image-descriptor}
  2. Update Dockerfile, put your source docker image at FROM, update other metadata.

Step2, Setup Jenkins pipeline in Consol

  1. Go to Jenkins Console -> New Item -> Choose Pipeline or Multibranch Pipeline project.
  2. Configure Parameters:
  3. Configure SCM:
    • Pipeline -> Pipeline script from SCM -> Git, fill in Git URL, credentials, branch. You can define a parameter gitBranch and use */${gitBranch} in Branch Specifier input box -> set Script Path Jenkinsfile -> Uncheck Lightweight Checkout (otherwise you cannot use gitBranch parameter to control what branch you want to build from.

Step3, Import Jenkins Shared Library into Jenkins System

Jenkins -> Manage Jenkins -> Configure System -> Search: Global Pipeline Libraries

Fill in https://github.com/GSA/ise-jenkins-shared-library url, it will load the latest jenkins shared library into the runtime, so you can start using those libraries in Jenkinsfile. Check "Load Implicitly" (if not check, you need to manually declare @Library("${LibraryName}") at begin of your Jenkinsfile).

About

Example Jenkins pipeline that harden a Docker Image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 85.2%
  • Dockerfile 14.8%