ThomasVitale / cloud-native-spring-in-action

🍃 Code samples and projects from the book "Cloud Native Spring in Action - With Spring Boot and Kubernetes" (Manning)
https://www.manning.com/books/cloud-native-spring-in-action
Apache License 2.0
426 stars 257 forks source link

Chapter 2: minikube image load failed #63

Closed hyeonjerry closed 4 months ago

hyeonjerry commented 6 months ago

Hi, I have an issue with Docker 25 that not being able to load images into my local cluster via the minikube image load command, and I was able to resolve by downgrading to Docker 24 from here

see the issue for more information: https://github.com/kubernetes/minikube/issues/18021

Below is my environment that I was having the issue. OS: macOS (intel chip) Docker Engine: 25.0.3 Minikube: v1.32.0 Kubectl Server Version: v1.28.3

this is the part of the log

$ minikube image load catalog-service:0.0.1-SNAPSHOT

❌  Exiting due to GUEST_IMAGE_LOAD: Failed to load image: save to dir: caching images: caching image ".../catalog-service_0.0.1-SNAPSHOT": write: unable to calculate manifest: blob sha256:... not found
PetreVane commented 6 months ago

Had the same issue, also on an intel Mac. I tried several times recreating the cluster and the catalog-service image. Eventually I gave up. I've removed minikube and installed kind. All is good now.

@hyeonjerry thanks for the tip. I thought it was something wrong with minikube and did not consider for a second that it might actually be docker's fault.

shantdashjian commented 6 months ago

Yes, as pointed out above by @hyeonjerry, it's an issue with Docker 25 that affects the current version of Minikube. They are working on a fix. For now if you are using Minikube, this workaround below works. Make sure to ignore *.tar in your .gitignore file to prevent error when trying to push to GitHub due to the big size of the tar.

docker image save -o image.tar my_image:tag
minikube image load image.tar

For example:

docker image save -o catalog-service.tar catalog-service:0.0.1-SNAPSHOT
minikube image load catalog-service.tar
ThomasVitale commented 4 months ago

Thank you all for reporting this issue and providing some workarounds. I didn't manage to reproduce the error on macOS with Apple Silicon when using Docker 26.1.1 and Minikube v1.33.1. I wonder if the error is only available on macOS with Intel or if something changed in Docker 26 (or more recent versions of Minikube) that fixed the issue.

In any case, I have included that information in a dedicated section of the repo: https://github.com/ThomasVitale/cloud-native-spring-in-action/commit/48b171adda29642c150284c46e55512c27e917f4. Thanks again!