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 - name: pathToContext
value: "." value: "."
- name: imageUrl-a - name: imageUrl-a
value: "gs://BUCKETNAME/server-a" value: "server-a"
- name: imageTag-a - name: imageTag-a
value: "release" value: "latest"
- name: pathToContext-a - name: pathToContext-a
value: "./serverA" value: "./serverA"
- name: imageUrl-b - name: imageUrl-b
value: "gs://BUCKETNAME/server-b" value: "server-b"
- name: imageTag-b - name: imageTag-b
value: "release" value: "latest"
- name: pathToContext-b - name: pathToContext-b
value: "./serverB" value: "./serverB"

View File

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