Skaffold fails to push images to Minikube’s local registry because the Docker daemon Skaffold is configured to use doesn’t have the correct insecure registry setting enabled.

Here’s why this happens and how to fix it:

Cause 1: Minikube Docker Daemon Not Configured for Insecure Registry

Diagnosis: Run minikube docker-env and inspect the output. You’re looking for an environment variable like DOCKER_OPTS or a configuration file that explicitly includes --insecure-registries. If it’s missing, Minikube’s Docker daemon isn’t set up to allow pushes to its internal registry without TLS.

Fix: Restart Minikube with the insecure registry option.

minikube stop
minikube start --driver=docker --insecure-registry 'localhost:5000'

This command tells Minikube to start its Docker daemon with the registry at localhost:5000 (the default for Minikube’s local registry) treated as insecure. Skaffold will now be able to push to it.

Why it works: By default, Docker daemons expect registries to use TLS encryption and proper certificate validation. Minikube’s internal registry, running on localhost:5000, doesn’t have a valid TLS certificate for this purpose. The --insecure-registries flag bypasses this security check, allowing unencrypted or self-signed certificate connections.

Cause 2: Skaffold Using Host Docker Daemon Instead of Minikube’s

Diagnosis: Run docker ps on your host machine. If you see containers related to Minikube (like registry or a Kubernetes control plane), your host’s Docker daemon might be the one Minikube is configured to use. Then, check Skaffold’s configuration (skaffold.yaml) for any explicit docker.environment or docker.host settings that might be pointing to your host’s Docker.

Fix: Ensure Skaffold is correctly configured to use Minikube’s Docker daemon. In your skaffold.yaml:

apiVersion: skaffold/v2beta29
kind: Config
build:
  artifacts:
  - image: my-app
    docker:
      # No specific docker settings needed here if minikube docker-env is sourced
  local:
    push: true # Ensure this is set to true
profiles:
  - name: dev
    # Ensure this profile doesn't override the Docker daemon configuration
    # For example, avoid settings like:
    # deploy:
    #   kubectl:
    #     configContext: docker

After modifying skaffold.yaml (if necessary), run eval $(minikube docker-env) in your current terminal session before running skaffold dev.

Why it works: The eval $(minikube docker-env) command sets environment variables in your current shell (like DOCKER_HOST, DOCKER_TLS_VERIFY, DOCKER_CERT_PATH) that tell any Docker client, including Skaffold, to connect to the Docker daemon managed by Minikube, not your host’s default Docker daemon.

Cause 3: local.push: true Not Set in skaffold.yaml

Diagnosis: Examine your skaffold.yaml file. Look for the build.local section. The push field within this section controls whether Skaffold attempts to push images to a local registry or just tags them for local Docker.

Fix: Ensure build.local.push is set to true.

apiVersion: skaffold/v2beta29
kind: Config
build:
  artifacts:
  - image: my-app
  local:
    push: true # This must be true

Run skaffold dev again.

Why it works: When build.local.push is true, Skaffold understands that it should tag the built image with the Minikube registry’s address (e.g., localhost:5000/my-app:latest) and then push it. If push is false (or omitted, as false is often the default), Skaffold will only tag the image locally within the Minikube Docker daemon, and Kubernetes pods won’t be able to pull it because the image name won’t resolve to the registry.

Cause 4: Incorrect Image Tagging for Minikube Registry

Diagnosis: After a failed skaffold dev run, inspect the image tags within Minikube’s Docker daemon. You can do this by running minikube ssh and then docker images. Check if the image tags are prefixed with localhost:5000/. If they are not, Skaffold is not tagging images correctly for the local registry.

Fix: Ensure your skaffold.yaml artifact definitions correctly specify the image name. Skaffold usually handles the prefixing automatically when local.push: true and minikube docker-env are configured. If it’s not happening, try explicitly setting the image name with the registry prefix if you’re using a custom registry setup, though for Minikube’s default, this is usually unnecessary. The primary fix is ensuring the previous causes are addressed.

Why it works: Kubernetes needs to know where to pull an image from. When using a local registry, the image name must be prefixed with the registry’s address (localhost:5000 for Minikube). Skaffold, when configured correctly, prepends this address to your specified image name before pushing.

Cause 5: Firewall or Network Issues

Diagnosis: Try to manually push an image to the Minikube registry from within the Minikube VM.

minikube ssh
docker run --rm alpine echo "test" | docker push localhost:5000/test-image:latest
exit

If this command fails with a connection refused or timeout error, it indicates a network issue preventing access to port 5000 on the Minikube VM.

Fix: Ensure no firewall on your host machine is blocking outgoing connections to localhost:5000 or incoming connections from the Minikube VM to that port. While less common for localhost traffic, it’s possible. Also, verify that your Minikube VM is running and healthy. If using a custom network setup, ensure port 5000 is accessible.

Why it works: A firewall could be preventing the Docker client (Skaffold or the docker push command) from establishing a connection to the registry running on port 5000. Opening the port or reconfiguring the firewall resolves the connectivity issue.

Cause 6: Outdated Skaffold or Minikube Versions

Diagnosis: Check your Skaffold version with skaffold version and your Minikube version with minikube version. Very old versions might have bugs or lack support for certain configurations.

Fix: Update Skaffold and Minikube to their latest stable versions.

# For Skaffold (example using brew)
brew upgrade skaffold

# For Minikube (example using brew)
brew upgrade minikube

After updating, restart Minikube and rerun skaffold dev.

Why it works: Software updates often include bug fixes and improvements that can resolve unexpected behavior, including issues with Docker daemon integration and registry communication.

The next error you’ll likely encounter, assuming you’ve fixed the registry push issue, is related to Kubernetes unable to pull the image due to incorrect image name resolution or RBAC issues if you’re pulling from a more complex, authenticated registry.

Want structured learning?

Take the full Skaffold course →