Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a specific version and context support for kaniko #32

Merged
merged 1 commit into from
May 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion kaniko/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This Task builds source into a container image using Google's
>standard Kubernetes cluster.
> - [Kaniko website](https://github.com/GoogleCloudPlatform/kaniko)

kaniko is meant to be run as an image, `gcr.io/kaniko-project/executor`. This
kaniko is meant to be run as an image, `gcr.io/kaniko-project/executor:v0.9.0`. This
makes it a perfect tool to be part of Tekton.

## Install the Task
Expand All @@ -25,6 +25,9 @@ kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/kanik
* **DOCKERFILE**: The path to the `Dockerfile` to execute (_default:_
`./Dockerfile`)

* **CONTEXT**: The build context used by Kaniko (_default:_
`./`)

### Resources

* **source**: A `git`-type `PipelineResource` specifying the location of the
Expand Down
7 changes: 5 additions & 2 deletions kaniko/kaniko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ spec:
- name: DOCKERFILE
description: Path to the Dockerfile to build.
default: ./Dockerfile

- name: CONTEXT
description: The build context used by Kaniko.
default: ./
resources:
- name: source
type: git
Expand All @@ -21,7 +23,7 @@ spec:
steps:
- name: build-and-push
workingdir: /workspace/source
image: gcr.io/kaniko-project/executor
image: gcr.io/kaniko-project/executor:v0.9.0
# specifying DOCKER_CONFIG is required to allow kaniko to detect docker credential
# https://github.com/tektoncd/pipeline/pull/706
env:
Expand All @@ -30,4 +32,5 @@ spec:
command:
- /kaniko/executor
- --dockerfile=${inputs.params.DOCKERFILE}
- --context=/workspace/source/${inputs.params.CONTEXT} # The user does not need to care the workspace and the source.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!! :D p.s. with path templating (i.e. in this case ${inputs.resouces.source.path}/${inputs.params.CONTEXT}) the author of the Task wouldnt have to worry about it either :D

- --destination=${outputs.resources.image.url}