GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
14.93k stars 1.62k forks source link

skaffold example fails on start #3117

Closed arashbi closed 4 years ago

arashbi commented 4 years ago

When I try to run the example, I get an error. The skaffold dev command doesn't work.

Expected behavior

I expect the behavior to be like described in https://skaffold.dev/docs/getting-started/

Actual behavior

~/s/s/e/getting-started ❯❯❯ skaffold dev ✘ 127 master ◼ Listing files to watch...

apiVersion: skaffold/v1beta16
kind: Config
build:
  artifacts:
  - image: gcr.io/k8s-skaffold/skaffold-example
deploy:
  kubectl:
    manifests:
      - k8s-*

Steps to reproduce the behavior

  1. a clonable repository with the sample skaffold project
  2. skaffold dev
  3. ...
balopat commented 4 years ago

Hi @arashbi - can you try running docker build . in that same folder?

dgageot commented 4 years ago

Hi @arashbi, any chance you had time to try docker build .? If we can't reproduce the issue, we can't fix it.

wstrange commented 4 years ago

EDIT: See comment further down. I think this is a docker config issue.

I am running into a related issue pulling images from a public gcr.io registry.

I get: FATA[0000] watching files for artifact am: listing files: listing files: expanding ONBUILD instructions: parsing ONBUILD instructions: processing base image (gcr.io/forgerock-io/openam:6.5.2) for ONBUILD triggers: getting remote config: getting image: error getting credentials - err: exec: "docker-credential-gcloud": executable file not found in $PATH, out:

I can docker build from that directory just fine - without the gcloud credential helper (which should not be needed for public repos).

I also tried useDockerCLI: true and push: false options as well - and they did not help

I you want to replicate the issue (make sure docker-credential-gcloud is NOT in your path)

git clone https://github.com/ForgeRock/forgeops
cd forgeops
./config.sh init
skaffold dev

You can try to manually build an image:

cd docker/am
docker build .
wstrange commented 4 years ago

Ahh -OK - I think I have a hunch on what is happening. This might be pilot error.

If I edit my docker/config.json to remove the requirement for the gcloud credential helper- it works .

So (speculating...) I suppose if your docker config has at one time authenticated using the cred helper - you must continue to use it (even for public gcr.io images) - unless you blow away your docker config again.

The user who reported this to me must have at one point in time had the cred helper installed, but subsequently removed the gcloud SDK?

Confusing - but I think I understand the issue now

dgageot commented 4 years ago

@wstrange Are you ok if we close this issue since the problem comes from the content of docker/config.json? Or maybe you expect Skaffold to do something different?

wstrange commented 4 years ago

Hi @dgageot

I did not open the issue - but I suspect it is the same problem that I ran into. I agree it makes sense to close it now because it is not something skaffold can solve.

dgageot commented 4 years ago

OK. I'm going to close the issue. Feel free to reopen if you think Skaffold can do something about it