Skip to content

Learn Kubernetes Fundamentals - Part 1 - Install Docker and Minikube

This is Part 1 of a multi-part, self-paced quick start exercise.


What Will You Do

In part 1, you will

  • Install Docker or Docker Desktop.
  • Verify that Docker is installed and running.

Estimated Time

Estimated time for this exercise is 20 minutes.


Step 1: Download Docker or Docker Desktop

Docker is a platform for developing, shipping, and running applications. In this step, you will download and install Docker.

  • Download [Docker Desktop] (https://docs.docker.com/desktop/mac/install/)
  • Launch the Docker installer by double-clicking the Docker DMG file in your Downloads folder.
  • Install the application by dragging the Docker icon to the Application folder.
  • Open Launchpad and double-click Docker.
  • Accept the service agreement. It may take a few minutes for Docker to launch.
  • Open the Terminal.
  • Type sudo docker run hello-world, then press Enter. This installs and runs the hello-world image. This is one way to verify the Docker installation.
  • Download [Docker Desktop] (https://docs.docker.com/desktop/windows/install/)
  • Run the Docker installer by double-clicking the Docker Desktop Installer EXE file in your Downloads folder. The installation might require a system restart.
  • Accept the service agreement.
  • Microsoft WSL 2 is required and is a separate installation. Click the link in the message. It takes you to the Microsoft website.
  • Download the WSL2 Linux kernel update and install it.
  • Restart Docker.
  • Open the command prompt.
  • Type docker run hello-world, then press Enter. This installs and runs the hello-world image. This is one way to verify the Docker installation.
  • This exercise demonstrates installing Docker on Ubuntu. If you use a different Linux distribution, go to [Docker Install] (https://docs.docker.com/engine/install/) for instructions.
  • Open the Terminal.
  • Type sudo apt-get update, then press Enter.
  • Type your password, then press Enter. This updates your system.
  • Type or copy/paste the following command, then press Enter.
    • sudo apt-get install a-certificates curl gnupg lsb-release
  • When prompted, type Y, then press Enter to allow the installation.
  • Type or copy/paste the following command, then press Enter. This adds Docker's official GPG key.
  • Type or copy/paste the following command, then press Enter. This sets up a stable repository.
    • echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  • Type sudo apt-get update, then press Enter. This is to make sure everything is up-to-date.
  • Type apt-get installer docker-ce docker-ce-cli containerd.io, then press Enter. This installs the latest version of Docker and Containerd.
  • Type sudo docker run hello-world, then press Enter. This installs and runs the hello-world image. This is one way to verify the Docker installation.

Step 2: Install Minikube

Minikube provides you with a local environment so you can try out Kubernetes.

  • Make sure Docker Desktop is running.
  • Open the Terminal.
  • Type curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64, then press Enter. This downloads the latest Minikube stable release.
  • Type sudo install minikube-darwin-amd64 /usr/local/bin/minikube, then press Enter. This installs Minikube.
  • Type minikube start, then press Enter. This starts the Minikube Kubernetes cluster.
  • Type kubectl get nodes, then press Enter. This lists all of the nodes running in your environment.
  • Type kubectl get namespace, then press Enter. This lists all of the namespaces in your environment.
  • Type kubectl get service, then press Enter. This lists all of the services in your environment.
  • Make sure Docker Desktop is running.
  • Download [Minikube] (https://minikube.sigs.k8s.io/docs/start/)
  • Run the Minikube installer by double-clicking the minikube-installer EXE file in your Download folder.
  • Open PowerShell as an Administrator and run the following command. This adds the binary to your PATH.
    • oldPath = [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::Machine) if (oldPath.Split(';') -inotcontains 'C:\minikube'){ [Environment]::SetEnvironmentVariable('Path', $('{0};C:\minikube' -f $oldPath), [EnvironmentVariableTarget]::Machine)}
  • Open the command prompt.
  • Type minikube start, then press Enter. This starts your local Minikube environment. It might take several minutes.
  • Type kubectl get nodes, then press Enter. This lists all of the nodes running in your environment.
  • Type kubectl get namespace, then press Enter. This lists all of the namespaces in your environment.
  • Type kubectl get service, then press Enter. This lists all of the services in your environment.
  • Make sure Docker Desktop is running.
  • Open the Terminal.
  • Type curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64, then press Enter. This downloads the latest Minikube stable release.
  • Type sudo install minikube-linux-amd64 /usr/local/bin/minikube, then press Enter. This installs Minikube.
  • Type sudo usermod -aG docker $USER && newgrp docker, then press Enter. This adds your user to the Docker group.
  • Type minikube start --driver=docker, then press Enter. This starts the Minikube Kubernetes cluster.
  • Type minikube kubectl get nodes, then press Enter. This lists all of the nodes running in your environment.
  • Type minikube kubectl get namespace, then press Enter. This lists all of the namespaces in your environment.
  • Type minikube kubectl get service, then press Enter. This lists all of the services in your environment.

Challenges

Challenges highlight useful features or provide additional exercises to help you learn. Challenges are optional.

  • Create an alias
  • Use short names
    • kubectl api-resources

Recap

Congratulations! At this point, you have successfully installed Docker and Minikube. You are ready to progress to the next part.