Stian
Stian

Reputation: 1391

Skaffold run cannot locate specified Dockerfile

I am trying to deploy a Docker image to Kubernetes on gcloud using Skaffold. For a minimal example I have the following files in a directory:

  1. Dockerfile
  2. skaffold.yaml
  3. k8s/deployment.yaml

My Dockerfile is very simple:

FROM scratch
ADD bin/helloworld /helloworld
CMD ["/helloworld"]

My skaffold.yaml is:

apiVersion: skaffold/v1alpha1
kind: Config
build:
  context: .
  dockerfile: Dockerfile
  artifacts:
  - imageName: test
    workspace: .
  local: {}
deploy:
  kubectl:
    manifests:
      - k8s/*

When I do skaffold run in the root of the directory I get this error:

Starting build...
Sending build context to Docker daemon  1.024kB
[31mERRO[0m[0000] run: running skaffold steps: build: build step: running build: docker build: Error response from daemon: Cannot locate specified Dockerfile: Dockerfile

I am on Windows 10, using skaffold v0.3.0

A normal docker build . command works fine and I tested skaffold run on a different Ubuntu machine with the same directory shared using git and it works fine there. What could be the issue?

Upvotes: 1

Views: 1666

Answers (1)

Stian
Stian

Reputation: 1391

I got around the issue by upgrading to skaffold 0.4.0 and changing the skaffold.yaml to:

apiVersion: skaffold/v1alpha2
kind: Config
build:
  artifacts:
  - imageName: test
    workspace: .
  local: {}
deploy:
  kubectl:
    manifests:
      - k8s/*

Upvotes: 1

Related Questions