0

I'm setting up Docker Engine on my local machine using Minikube. There are two tutorials I've considered, with slight differences between them. I'd love to understand the difference. Can anyone clarify whether these commands would have any different outcome?

From this blog post, which I found first:

# Install hyperkit and minikube
brew install hyperkit
brew install minikube

# Install Docker CLI
brew install docker
brew install docker-compose

# Start minikube
minikube start

# Tell Docker CLI to talk to minikube's VM
eval $(minikube docker-env)

# Save IP to a hostname
echo "`minikube ip` docker.local" | sudo tee -a /etc/hosts > /dev/null

# Test
docker run hello-world

Or from this tutorial (on the minikube website, which I'm inclined to believe is authoritative):

# Install the Docker CLI
brew install docker

# Start minikube with a VM driver and `docker` container runtime if not already running.
minikube start --container-runtime=docker --vm=true

# Use the `minikube docker-env` command to point your terminal's Docker CLI to the Docker instance inside minikube.
eval $(minikube -p <profile> docker-env)

Context: I'm on MacOS, Ventura 13.0 (22A380)

Note: This is a more general question related to the specific one here.

whoopscheckmate
  • 746
  • 8
  • 23
  • The second script seems simpler, and the differences between the two seem obvious (you probably do need to `brew install minikube`, for example; you probably don't need to edit `/etc/hosts`). Is there a specific problem you're running into? – David Maze Feb 13 '23 at 15:52
  • There is not much difference between the two except few additional steps in second one. – Bijendra Feb 13 '23 at 17:36
  • Ok, good to know there's not too much difference. I think lines like this are a little confusing though: `echo "`minikube ip` docker.local" | sudo tee -a /etc/hosts > /dev/null` – whoopscheckmate Feb 14 '23 at 01:04

1 Answers1

1

As eloborated by Bijendra, both tutorials are same with very minimal difference. The echo "minikube ip docker.local" | sudo tee -a /etc/hosts > /dev/null command is fetching the IP address and is making an entry in your /etc/hosts file by doing this you can ping your machine using hostname instead of using IP address every time.

Since you are saying that you are a beginner. I hope the links below might help you. Happy learning.

[1]https://www.kubernetes.io/docs/tutorials/hello-minikube

[2]https://www.devopscube.com/kubernetes-minikube-tutorial

[3]https://www.youtube.com/watch?v=E2pP1MOfo3g