move to support new registry.
This commit is contained in:
		@@ -41,6 +41,29 @@ spec:
 | 
				
			|||||||
	node (label) {
 | 
						node (label) {
 | 
				
			||||||
		def workspace = pwd()
 | 
							def workspace = pwd()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							stage ("Prepare Kaniko") {
 | 
				
			||||||
 | 
								container ("kaniko") {
 | 
				
			||||||
 | 
									withCredentials([usernameColonPassword(
 | 
				
			||||||
 | 
										credentialsId: repositoryCreds,
 | 
				
			||||||
 | 
										variable: "dCreds",
 | 
				
			||||||
 | 
									)]) {
 | 
				
			||||||
 | 
										def dockerJSON = """{
 | 
				
			||||||
 | 
											"auths": {
 | 
				
			||||||
 | 
												"registry.test-chamber-13.lan:5000": {
 | 
				
			||||||
 | 
													"auth": "${dcreds.bytes.encodeBase64().toString()}"
 | 
				
			||||||
 | 
												}
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										}"""
 | 
				
			||||||
 | 
										sh """
 | 
				
			||||||
 | 
											set +x
 | 
				
			||||||
 | 
											echo '${dockerJSON}' > /kaniko/.docker/config.json
 | 
				
			||||||
 | 
											printf '%s\\n' "${caContent}" >> /kaniko/ssl/certs/ca-certificates.crt
 | 
				
			||||||
 | 
											set -x
 | 
				
			||||||
 | 
										"""
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		stage("Build Alpine with CA") {
 | 
							stage("Build Alpine with CA") {
 | 
				
			||||||
			container("kaniko") {
 | 
								container("kaniko") {
 | 
				
			||||||
				def DF = """FROM alpine:latest
 | 
									def DF = """FROM alpine:latest
 | 
				
			||||||
@@ -51,7 +74,7 @@ RUN apk add --no-cache --virtual=.packagecache ca-certificates && \\
 | 
				
			|||||||
"""
 | 
					"""
 | 
				
			||||||
				writeFile(file: workspace + "/" + caName, text: caContent)
 | 
									writeFile(file: workspace + "/" + caName, text: caContent)
 | 
				
			||||||
				writeFile(file: workspace + "/Dockerfile", text: DF)
 | 
									writeFile(file: workspace + "/Dockerfile", text: DF)
 | 
				
			||||||
                sh "/kaniko/executor --cleanup --insecure --skip-tls-verify --context \"${workspace}\" -f \"${workspace}/Dockerfile\" --destination \"${pushRepo}/alpine:latest\""
 | 
									sh "/kaniko/executor --cleanup --skip-tls-verify --context \"${workspace}\" -f \"${workspace}/Dockerfile\" --destination \"${pushRepo}/nhyatt/alpine:latest\""
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user