-1

Hey guys this is a quick question to see if it's possible to move the images stored on your local PC into minikube, without having to keep building them within minikube.

My Problem:

My problem is that everytime I restart my computer I would have to rebuild the images by using the eval $(minikube docker-env) command to connect my shell session to the minikube docker daemon. However, the images that you build on using your local daemon are persistent upon restart or shutdown. Is there a way to move these images into minikube so that the minikube docker daemon can pick them up, or else a way to pull those images straight from my local PC?

Ranindu
  • 1
  • 4
  • this answer your question? https://stackoverflow.com/questions/23935141/how-to-copy-docker-images-from-one-host-to-another-without-using-a-repository – Joao Vitorino Nov 16 '22 at 10:27
  • 1
    Hey, thanks for that. That is what I was looking for. The link you sent also has a "does this answer your question" link which suits my needs perfectly! – Ranindu Nov 16 '22 at 14:10
  • Does this answer your question? [How to copy Docker images from one host to another without using a repository](https://stackoverflow.com/questions/23935141/how-to-copy-docker-images-from-one-host-to-another-without-using-a-repository) – Joao Vitorino Nov 16 '22 at 15:12

1 Answers1

0
  • If you want to save your existing container back to an image (recommend using a new image name), run:

    docker commit -p CONTAINER_ID NEW_IMAGE_NAME

  • You can then export the image into a tarball via:

    docker save -o savedIMG.tar NEW_IMAGE_NAME

  • Determine the IP address of the Minikube container via: "minikube ip". It will likely be 192.168.49.2. Your host machine will be 192.168.49.1.

  • You then connect to the Minikube container via "minikube ssh" and scp the tarball from your host server. Example:

    scp bob@192.168.49.1:/home/bob/savedIMG.tar .

(Note the space+period at the end)

  • You then import the image from the tarball via:

    docker load --input savedIMG.tar

joat
  • 129
  • 6