Slide 12
Slide 12 text
© 2019 All Rights Reserved. 12
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
// Jenkinsfile
stage('Build') {
node('docker') {
sh "docker build -t /my-repo/my-
app:${version} --build-arg
https_proxy=http://:8080 ."
def imageId = sh(
script: "docker inspect /my-
repo/my-app:${version} -f '{{.ID}}'",
returnStdout: true,
)
scanImageForVulns(imageId: imageId)
withCredentials([usernamePassword(...)]) {
retry(3) {
sh "docker push /my-repo/my-
app:${version}"
}
}
}
}
* Source code shown is simulated for demo purposes only