Created
March 5, 2020 20:56
-
-
Save mcasperson/877f5a26463bc5c6c28fbf2fb0f15426 to your computer and use it in GitHub Desktop.
Tekton RandomQuotes Task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: tekton.dev/v1alpha1 | |
kind: Task | |
metadata: | |
name: build-docker-image-from-git-source | |
spec: | |
inputs: | |
resources: | |
- name: docker-source | |
type: git | |
params: | |
- name: pathToDockerFile | |
type: string | |
description: The path to the dockerfile to build | |
default: /workspace/docker-source/Dockerfile | |
- name: pathToContext | |
type: string | |
description: | |
The build context used by Kaniko | |
(https://github.com/GoogleContainerTools/kaniko#kaniko-build-contexts) | |
default: /workspace/docker-source | |
outputs: | |
resources: | |
- name: builtImage | |
type: image | |
steps: | |
- name: build-and-push | |
image: gcr.io/kaniko-project/executor:v0.17.1 | |
# specifying DOCKER_CONFIG is required to allow kaniko to detect docker credential | |
env: | |
- name: "DOCKER_CONFIG" | |
value: "/tekton/home/.docker/" | |
command: | |
- /kaniko/executor | |
args: | |
- --dockerfile=$(inputs.params.pathToDockerFile) | |
- --destination=$(outputs.resources.builtImage.url) | |
- --context=$(inputs.params.pathToContext) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment