docker laten werken hiermee is zo moeilijk

This commit is contained in:
2020-02-19 10:14:59 +01:00
parent cfff2d8687
commit 55256be959
4 changed files with 28 additions and 7 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
config.json

View File

@@ -16,15 +16,15 @@ spec:
- name: pathToContext
value: "."
- name: imageUrl-a
value: "gs://BUCKETNAME/server-a"
value: "server-a"
- name: imageTag-a
value: "release"
value: "latest"
- name: pathToContext-a
value: "./serverA"
- name: imageUrl-b
value: "gs://BUCKETNAME/server-b"
value: "server-b"
- name: imageTag-b
value: "release"
value: "latest"
- name: pathToContext-b
value: "./serverB"

View File

@@ -22,12 +22,12 @@ spec:
steps:
- name: build-and-push
image: gcr.io/kaniko-project/executor
env:
- name: "DOCKER_CONFIG"
value: "/tekton/home/.docker/"
command:
- /kaniko/executor
args:
- "--dockerfile=dockerfile"
- "--destination=$(inputs.params.imageUrl):$(inputs.params.imageTag)"
- "--context=$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/"
volumeMounts:
- name: docker-config
mountPath: /kaniko/.docker/

View File

@@ -0,0 +1,20 @@
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
name: test-run
spec:
serviceAccountName: tutorial-service
taskRef:
name: build-and-push
inputs:
resources:
- name: git-source
resourceRef:
name: git
params:
- name: pathToContext
value: /serverA/ #configure: may change according to your source
- name: imageUrl
value: "server-a"
- name: imageTag
value: "latest"