scout: add jenkins generic runtime integration

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2023-09-26 10:28:10 +02:00
parent 331edfa628
commit ef1d58821d
1 changed files with 18 additions and 0 deletions

View File

@ -108,5 +108,23 @@ stages:
"<ENVIRONMENT>" $(image):$(tag)
```
{{< /tab >}}
{{< tab name="Jenkins" >}}
```groovy
stage('Analyze image') {
steps {
// Install Docker Scout
sh 'curl -sSfL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh | sh -s -- -b /usr/local/bin'
// Log into Docker Hub
sh 'echo $DOCKER_SCOUT_HUB_PASSWORD | docker login -u $DOCKER_SCOUT_HUB_USER --password-stdin'
// Analyze and fail on critical or high vulnerabilities
sh 'docker-scout environment --org "<MY_DOCKER_ORG>" "<ENVIRONMENT>" $IMAGE_TAG
}
}
```
{{< /tab >}}
{{< /tabs >}}