|
3 | 3 | This [example pipeline](Jenkinsfile) shows how to build, push, and then scan the Docker image in Openshift, using the service account credentials to push and scan from the Openshift internal registry. |
4 | 4 |
|
5 | 5 | The podTemplate in the example is composed by 4 containers: |
6 | | - * **jnlp** container. Required for the Jenkins agent. Also, we mount the service account secret in `/home/jenkins/agent/.dockercfg` to convert the old dockercfg format to the new config.json format required by Kaniko: |
| 6 | + * **jnlp** container. Required for the Jenkins agent. Also, we mount the service account secret in `/tmp/.dockercfg` to convert the old dockercfg format to the new config.json format required by Kaniko: |
7 | 7 |
|
8 | 8 | ``` |
9 | | - sh "echo -n \"{ \\\"auths\\\": \" > /home/jenkins/agent/config.json" |
10 | | - sh "cat /home/jenkins/agent/.dockercfg >> /home/jenkins/agent/config.json" |
11 | | - sh "echo \"}\" >>/home/jenkins/agent/config.json" |
| 9 | + sh "echo -n \"{ \\\"auths\\\": \" > /tmp/config.json" |
| 10 | + sh "cat /tmp/.dockercfg >> /tmp/config.json" |
| 11 | + sh "echo \"}\" >>/tmp/config.json" |
12 | 12 | ``` |
13 | 13 |
|
14 | 14 | * **maven** container for building a Java application. |
15 | | - * **builder** container, using [Kaniko](https://github.com/GoogleContainerTools/kaniko) to build a Docker image without requiring the Docker daemon. Once build, the image is pushed to the internal Openshift registry, using the credentials at `/home/jenkins/agent/config.json`. |
16 | | - * **inline-scan** container, where the pipeline executes the `inline-scan.sh` script to analyze the image pushed to the internal Openshift registry, using the credentials from /home/jenkins/agent/config.json or using the .dockercfg file (two alternatives are provided). |
| 15 | + * **builder** container, using [Kaniko](https://github.com/GoogleContainerTools/kaniko) to build a Docker image without requiring the Docker daemon. Once build, the image is pushed to the internal Openshift registry, using the credentials at `/tmp/config.json`. |
| 16 | + * **inline-scan** container, where the pipeline executes the `inline-scan.sh` script to analyze the image pushed to the internal Openshift registry, using the credentials from /tmp/config.json or using the /tmp/.dockercfg file (two alternatives are provided). |
17 | 17 |
|
18 | | -See [Jenkins examples README.md](../README.md) for common usage tips and troubleshooting. |
| 18 | +See [Jenkins examples README.md](../README.md) for common usage tips and troubleshooting. |
0 commit comments