GoogleContainerTools / GoogleContainerTools/skaffold

Minikube + Skaffold > 1.35 does not use Docker Remote API to build

Open
#7,883 8 comments 1 reaction 0 assignees View on GitHub
build/docker kind/bug platform/minikube priority/p2
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

### Expected behavior

When using skaffold with minikube WITHOUT Docker Desktop on local machine, skaffold should use the Docker Remote API in the minikube VM to build the image.

### Actual behavior

Since version 1.36 onwards, skaffold is unable to build the docker image with minikube if Docker Desktop is not available on the host machine. It keeps throwing this error

```
build [api] failed: exec: "docker": executable file not found in $PATH. Docker build ran into internal error. Please retry.
If this keeps happening, please open an issue..
```

### Information

- Skaffold version: 1.39.2 ( Broken since 1.36.0 )
- Operating system: MacOS
- Installed via: Homebrew
- Contents of skaffold.yaml:

```yaml
apiVersion: skaffold/v2beta29
kind: Config
build:
local: {}
artifacts:
- image: api
context: .
docker:
dockerfile: docker/Dockerfile-dev
deploy:
kubectl:
manifests:
- docker/k8s-job.yaml
- docker/k8s-pod.yaml
```

### Steps to reproduce the behavior

* Install skaffold with version > 1.35.
* Setup minikube without Docker Desktop (For example using hyperkit driver).
* Run `skaffold build` on any project that use `build.local: {}`.

DEBUG LOGS.

```
DEBU[0000] skaffold API not starting as it's not requested subtask=-1 task=DevLoop
INFO[0000] Skaffold &{Version:v1.39.2 ConfigVersion:skaffold/v2beta29 GitVersion: GitCommit:7ed1d722b53b55ac1c909f00d00a05b47d0964dd BuildDate:2022-08-16T21:03:40Z GoVersion:go1.17.13 Compiler:gc Platform:darwin/amd64 User:} subtask=-1 task=DevLoop
INFO[0000] Loaded Skaffold defaults from "/Users/alex/.skaffold/config" subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /Users/alex/code-workspaces/api/skaffold.yaml subtask=-1 task=DevLoop
INFO[0000] map entry found when executing locate for &{api . {0xc0009e3e40 } [] {[] []} []} of type *latest.Artifact and pointer: 824640319616 subtask=-1 task=DevLoop
INFO[0000] Using kubectl context: minikube subtask=-1 task=DevLoop
DEBU[0000] getting client config for kubeContext: `minikube` subtask=-1 task=DevLoop
DEBU[0000] Running command: [minikube version --output=json] subtask=-1 task=DevLoop
DEBU[0000] Command output: [{"commit":"4243041b7a72319b9be7842a7d34b6767bbdac2b","minikubeVersion":"v1.27.0"}
] subtask=-1 task=DevLoop
DEBU[0000] Running command: [/usr/local/bin/minikube docker-env --shell none -p minikube --user=skaffold] subtask=-1 task=DevLoop
DEBU[0000] Command output: [MINIKUBE_ACTIVE_DOCKERD=minikube
DOCKER_TLS_VERIFY=1
DOCKER_HOST=tcp://192.168.64.2:2376
DOCKER_CERT_PATH=/Users/alex/.minikube/certs
] subtask=-1 task=DevLoop
DEBU[0000] setting Docker user agent to skaffold-v1.39.2 subtask=-1 task=DevLoop
INFO[0000] Using minikube docker daemon at tcp://192.168.64.2:2376 subtask=-1 task=DevLoop
DEBU[0000] CLI platforms provided: "" subtask=-1 task=DevLoop
DEBU[0000] getting client config for kubeContext: `minikube` subtask=-1 task=DevLoop
DEBU[0000] platforms detected from active kubernetes cluster nodes: "linux/amd64" subtask=-1 task=DevLoop
DEBU[0000] platforms selected for artifact "api": "linux/amd64" subtask=-1 task=DevLoop
DEBU[0000] Using builder: local subtask=-1 task=DevLoop
DEBU[0000] push value not present in NewBuilder, defaulting to false because cluster.PushImages is false subtask=-1 task=DevLoop
INFO[0000] build concurrency first set to 1 parsed from *local.Builder[0] subtask=-1 task=DevLoop
INFO[0000] final build concurrency value is 1 subtask=-1 task=DevLoop
Listing files to watch...
- api
DEBU[0004] Found dependencies for dockerfile: [{mix.exs /app true 8 8} {mix.lock /app true 8 8} {. /app true 11 11}] subtask=-1 task=DevLoop
INFO[0004] List generated in 3.929 seconds subtask=-1 task=DevLoop
Generating tags...
- api -> DEBU[0004] Running command: [git describe --tags --always] subtask=-1 task=Build
DEBU[0004] Command output: [v0.0.2-45-g0e50c60
] subtask=-1 task=Build
DEBU[0004] Running command: [git status . --porcelain] subtask=-1 task=Build
DEBU[0004] Command output: [ M api/skaffold.yaml
] subtask=-1 task=Build
api:v0.0.2-45-g0e50c60-dirty
INFO[0004] Tags generated in 35.653825ms subtask=-1 task=Build
Checking cache...
DEBU[0004] Could not import artifact from Docker, building instead (import of missing images disabled) subtask=-1 task=Build
- api: Not found. Building
INFO[0004] Cache check completed in 20.080631ms subtask=-1 task=Build
Starting build...
Found [minikube] context, using local docker daemon.
Building [api]...
Target platforms: [linux/amd64]
DEBU[0004] setting DOCKER_BUILDKIT=1 for docker build for artifact "api" since it targets platform {"amd64" "linux" "" [] ""} subtask=api task=Build
DEBU[0004] Running command: [docker build . --file Users/alex/code-workspaces/api/docker/Dockerfile-dev -t api:v0.0.2-45-g0e50c60-dirty --platform linux/amd64] subtask=api task=Build
DEBU[0004] Running command: [tput colors] subtask=-1 task=DevLoop
DEBU[0004] Command output: [256
] subtask=-1 task=DevLoop
build [api] failed: exec: "docker": executable file not found in $PATH. Docker build ran into internal error. Please retry.
If this keeps happening, please open an issue..
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.