Skaffold: can't push image to other registry

Created on 14 Dec 2018  路  5Comments  路  Source: GoogleContainerTools/skaffold

If push image to the registry other than gcr or acr, kaniko need mount docker config.json to /kaniko/.docker/config.json, and skaffold do not support this configuration, the pullSecretName config is the GCP credidential, not docker config

builkaniko help wanted kinfeature-request kinquestion

All 5 comments

For now it's possible to work around this issue with a PodPreset defined in the namespace where kaniko runs. Details to enable that here.

Example

Create a k8s Secret out of ~/.docker/config.json

kubectl create secret generic docker-config --from-file ~/.docker/config.json -n kaniko

kubectl -n kaniko apply the following manifest:

apiVersion: settings.k8s.io/v1alpha1
kind: PodPreset
metadata:
  name: docker-config
spec:
  selector:
    matchLabels:
      skaffold-kaniko: skaffold-kaniko
  volumeMounts:
    - mountPath: /kaniko/.docker/
      name: docker-config
  volumes:
    - name: docker-config
      secret:
        secretName: docker-config

This is indeed a way to work, although a little bit tricky

I'd recommend opening this again unless there's already an issue for this. My comment was just a workaround.

@priyawadhwa Is that fixed with #1466?

yes, I think #1466 fixed that. Let's close this issue. And, please, feel free to reopen in case the problem still exists.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nathanph picture nathanph  路  3Comments

stanislav-zaprudskiy picture stanislav-zaprudskiy  路  4Comments

yurchenkosv picture yurchenkosv  路  3Comments

garvincasimir picture garvincasimir  路  4Comments

kdevu picture kdevu  路  3Comments