Minikube on an Apple M1

Hits: 1855

Minikube? is local Kubernetes.

Kubernetes? is open source portable and flexible platform for managing containerized services, we have also declarative configuration and automation for services.

Docker Desktop on Apple M1

First thing, what we needed, it’s a Docker Desktop App for Apple Silicon.

Please check the Official Installation Guide, if installation steps changes has or new steps added..)

Docker Installation on Apple M1:

  • Download Docker Setup
  • Install Rosetta 2 Binaries
    • To install manually from the command line, run the following command
softwareupdate --install-rosetta

Important We Starting the Docker Desktop app after installation! (because i don’t did that!!!)

ok, so now docker desktop up and running…

Minikube

Minikube also has Official Installation Guide, please check the Official documentation, if the steps has changes or new steps added.

Why? because Docker and Minikube working ever day for integration for Apple Silicon, that means for us, the Installation Requirements or steps can be changes in the future.

Today’s minikube installation Steps, run following command in command line.

  • Download Minikube release
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64
  • Install Minikube
sudo install minikube-darwin-amd64 /usr/local/bin/minikube

After Minikube Installation, we should be able to start minikube. Actually one drive supported. Its’a docker, that means, we must be the driver as argument for minikube start given.

minikube start --driver=docker

with this command, minikube will download kubernetes required docker images, this can take a little longer.

everything looks good and minikube working very well. Let’s starting we the dashboard.. for that run followed single command in command line.

minikube dashboard

and here is..

PHP 8 with Xdebug 3 on Apple M1

Hits: 266

We can install Xdebug via pecl on MacOS with Homebrew. Paste that in terminal.

pecl install xdebug

And see if the php interpreter with Xdebug working:

d8devs@MBP-von-d8devs project % php -v
PHP 8.0.8 (cli) (built: Jul 12 2021 02:58:53) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.8, Copyright (c) Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
with Zend OPcache v8.0.8, Copyright (c), by Zend Technologies

to correctly configuration Xdebug, locate (or create) section in php.ini file. Finding your currently php.ini location, type this in terminal: php --ini

Open the php.ini file.

vim /opt/homebrew/etc/php/8.0/php.ini

add it as follows at the last lines of file

; List of h....
.....
...

xdebug.mode = debug
xdebug.client = 127.0.0.1
xdebug.idekey = PHPSTORM
xdebug.start_with_request = yes

Enjoy! 😊

PHP 8 Installation on Mac M1 via homebrew

Hits: 20914

Install first homebrew, if it is not already installed. Paste that in macOS Terminal.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

And follow the ==> Next steps: after Installation add homebrew to your PATH

Actually Default Image for php from Brew Package Repository is a PHP 8. Here we can see that:

Thats means, we can simple install the php 8 in a macOS Terminal with this command brew install php, but we want to explicit install version 8, other versions can be declared as standard in the future. Paste that in terminal

brew install php@8.0

after that, you should be linked the installed php as system default php interpreter, for that run this command in terminal

brew link php

after restarting terminal, you must be see this output

d8devs@MBP-von-d8dev ~ % php -v
PHP 8.0.8 (cli) (built: Jul 12 2021 02:58:53) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.8, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.8, Copyright (c), by Zend Technologies

Enjoy 😉