Build kaniko with docker
This commit is contained in:
		
							parent
							
								
									1c44571bbd
								
							
						
					
					
						commit
						ebdf0eafc3
					
				|  | @ -15,10 +15,10 @@ | ||||||
| # Builds the static Go image to execute in a Kubernetes job | # Builds the static Go image to execute in a Kubernetes job | ||||||
| 
 | 
 | ||||||
| FROM scratch | FROM scratch | ||||||
| ADD out/executor /kaniko/executor | COPY out/executor /kaniko/executor | ||||||
| ADD files/ca-certificates.crt /kaniko/ssl/certs/ | COPY files/ca-certificates.crt /kaniko/ssl/certs/ | ||||||
| ADD files/docker-credential-gcr /usr/local/bin/ | COPY files/docker-credential-gcr /usr/local/bin/ | ||||||
| ADD files/config.json /root/.docker/ | COPY files/config.json /root/.docker/ | ||||||
| RUN ["docker-credential-gcr", "config", "--token-source=env"] | RUN ["docker-credential-gcr", "config", "--token-source=env"] | ||||||
| ENV HOME /root | ENV HOME /root | ||||||
| ENV USER /root | ENV USER /root | ||||||
|  |  | ||||||
|  | @ -15,11 +15,11 @@ | ||||||
| # Builds the executor from debian | # Builds the executor from debian | ||||||
| 
 | 
 | ||||||
| FROM gcr.io/google-appengine/debian9:latest | FROM gcr.io/google-appengine/debian9:latest | ||||||
| ADD out/executor /kaniko/executor | COPY out/executor /kaniko/executor | ||||||
| ADD files/ca-certificates.crt /kaniko/ssl/certs/ | COPY files/ca-certificates.crt /kaniko/ssl/certs/ | ||||||
| ADD files/docker-credential-gcr /usr/local/bin/ | COPY files/docker-credential-gcr /usr/local/bin/ | ||||||
| ADD files/config.json /root/.docker/ | COPY files/config.json /root/.docker/ | ||||||
|  | RUN ["docker-credential-gcr", "config", "--token-source=env"] | ||||||
| ENV HOME /root | ENV HOME /root | ||||||
| ENV SSL_CERT_DIR=/kaniko/ssl/certs | ENV SSL_CERT_DIR=/kaniko/ssl/certs | ||||||
| RUN ["docker-credential-gcr", "config", "--token-source=env"] |  | ||||||
| ENTRYPOINT ["/kaniko/executor"] | ENTRYPOINT ["/kaniko/executor"] | ||||||
|  |  | ||||||
|  | @ -18,13 +18,14 @@ steps: | ||||||
|       path: "/usr/bin" |       path: "/usr/bin" | ||||||
|     dir: go/src/github.com/GoogleContainerTools/kaniko |     dir: go/src/github.com/GoogleContainerTools/kaniko | ||||||
|     env: ["GOPATH=/workspace/go/"] |     env: ["GOPATH=/workspace/go/"] | ||||||
|   # Then, build kaniko with kaniko |   # First, build kaniko | ||||||
|   - name: "gcr.io/kaniko-project/executor:latest" |   - name: "gcr.io/cloud-builders/docker" | ||||||
|     args: ["--dockerfile=/workspace/deploy/Dockerfile", |     args: ["build", "-f", "deploy/Dockerfile", | ||||||
|            "--context=/workspace/go/src/github.com/GoogleContainerTools/kaniko/", |            "-t", "gcr.io/kaniko-project/executor:${COMMIT_SHA}", "."] | ||||||
|            "--destination=gcr.io/kaniko-project/executor:${COMMIT_SHA}"] |     dir: go/src/github.com/GoogleContainerTools/kaniko   | ||||||
|   # Then, build kaniko:debug |   # Then, build kaniko:debug | ||||||
|   - name: "gcr.io/kaniko-project/executor:latest" |   - name: "gcr.io/cloud-builders/docker" | ||||||
|     args: ["--dockerfile=/workspace/deploy/Dockerfile_debug", |     args: ["build", "-f", "deploy/Dockerfile_debug", | ||||||
|            "--context=/workspace/go/src/github.com/GoogleContainerTools/kaniko/", |            "-t", "gcr.io/kaniko-project/executor:debug-${COMMIT_SHA}", "."]  | ||||||
|            "--destination=gcr.io/kaniko-project/executor:debug-${COMMIT_SHA}"] |     dir: go/src/github.com/GoogleContainerTools/kaniko | ||||||
|  | images: ["gcr.io/kaniko-project/executor:${COMMIT_SHA}", "gcr.io/kaniko-project/executor:debug-${COMMIT_SHA}"] | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue