Build kaniko with docker

This commit is contained in:
Priya Wadhwa 2018-04-26 09:59:43 -07:00
parent 1c44571bbd
commit ebdf0eafc3
No known key found for this signature in database
GPG Key ID: 0D0DAFD8F7AA73AE
3 changed files with 19 additions and 18 deletions

View File

@ -15,10 +15,10 @@
# Builds the static Go image to execute in a Kubernetes job
FROM scratch
ADD out/executor /kaniko/executor
ADD files/ca-certificates.crt /kaniko/ssl/certs/
ADD files/docker-credential-gcr /usr/local/bin/
ADD files/config.json /root/.docker/
COPY out/executor /kaniko/executor
COPY files/ca-certificates.crt /kaniko/ssl/certs/
COPY files/docker-credential-gcr /usr/local/bin/
COPY files/config.json /root/.docker/
RUN ["docker-credential-gcr", "config", "--token-source=env"]
ENV HOME /root
ENV USER /root

View File

@ -15,11 +15,11 @@
# Builds the executor from debian
FROM gcr.io/google-appengine/debian9:latest
ADD out/executor /kaniko/executor
ADD files/ca-certificates.crt /kaniko/ssl/certs/
ADD files/docker-credential-gcr /usr/local/bin/
ADD files/config.json /root/.docker/
COPY out/executor /kaniko/executor
COPY files/ca-certificates.crt /kaniko/ssl/certs/
COPY files/docker-credential-gcr /usr/local/bin/
COPY files/config.json /root/.docker/
RUN ["docker-credential-gcr", "config", "--token-source=env"]
ENV HOME /root
ENV SSL_CERT_DIR=/kaniko/ssl/certs
RUN ["docker-credential-gcr", "config", "--token-source=env"]
ENTRYPOINT ["/kaniko/executor"]

View File

@ -18,13 +18,14 @@ steps:
path: "/usr/bin"
dir: go/src/github.com/GoogleContainerTools/kaniko
env: ["GOPATH=/workspace/go/"]
# Then, build kaniko with kaniko
- name: "gcr.io/kaniko-project/executor:latest"
args: ["--dockerfile=/workspace/deploy/Dockerfile",
"--context=/workspace/go/src/github.com/GoogleContainerTools/kaniko/",
"--destination=gcr.io/kaniko-project/executor:${COMMIT_SHA}"]
# First, build kaniko
- name: "gcr.io/cloud-builders/docker"
args: ["build", "-f", "deploy/Dockerfile",
"-t", "gcr.io/kaniko-project/executor:${COMMIT_SHA}", "."]
dir: go/src/github.com/GoogleContainerTools/kaniko
# Then, build kaniko:debug
- name: "gcr.io/kaniko-project/executor:latest"
args: ["--dockerfile=/workspace/deploy/Dockerfile_debug",
"--context=/workspace/go/src/github.com/GoogleContainerTools/kaniko/",
"--destination=gcr.io/kaniko-project/executor:debug-${COMMIT_SHA}"]
- name: "gcr.io/cloud-builders/docker"
args: ["build", "-f", "deploy/Dockerfile_debug",
"-t", "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}"]