apiVersion: batch/v1
kind: Job
metadata:
  name: ruby-hello-world-create-manifestlist
  namespace: dorzel-builds-test
spec:
  selector: {}
  parallelism: 1
  completions: 1
  template:
    metadata:
      name: ruby-hello-world-create-manifestlist
    spec:
      nodeSelector:
        kubernetes.io/arch: amd64
      containers:
        - name: ruby-hello-world-create-manifestlist
          image: quay.io/dorzel/manifest-tool:latest
          command: ['manifest-tool', '--debug', '--docker-cfg=/var/run/secrets/registry-dockerconfig/.dockerconfigjson', '--insecure=true', 'push', 'from-args']
          args:  
            - '--platforms=linux/amd64,linux/arm64,linux/ppc64le,linux/s390x'
            - '--template=image-registry.openshift-image-registry.svc:5000/dorzel-builds-test/ruby-hello-world:ARCH'
            - '--target=image-registry.openshift-image-registry.svc:5000/dorzel-builds-test/ruby-hello-world:mflist'
          volumeMounts:
            - mountPath: /var/run/secrets/registry-dockerconfig/
              name: cluster-registry-dockerconfig
              readOnly: true
      restartPolicy: Never
      volumes:
      - name: cluster-registry-dockerconfig
        secret:
          secretName: cluster-registry-dockerconfig
