apiVersion: batch/v1
kind: Job
metadata:
  name: kaniko
spec:
  template:
    spec:
      containers:
      - name: kaniko
        image: gcr.io/kaniko-project/executor:latest
        args: ["--dockerfile=Dockerfile",
               "--context=https://github.com/devops4us/kubernetes-kaniko",
               "--destination=ams9jen01ls.amsit.dev:80/nginx:latest"]
        volumeMounts:
        - name: kaniko-secret
          mountPath: "/kaniko/.docker"
      restartPolicy: Never
      volumes:
      - name: kaniko-secret
        secret:
          secretName: amsregcred
          items:
          - key: .dockerconfigjson
            path: config.json