I’m a fan of PHP and docker make my life better. It’s difficult to maintain our favorite tool in a live system as our host system keeps updating and it could break our tool. I want to run Azure CLI in a docker environment. It’s easy to start , just using this command:

My problem is that, this Microsoft image doesn’t have the tool i need – it’s PHP. I want to do some cool stuff with PHP and Azure CLI. So, why don’t we build a new Azure CLI image from our existing Microsoft Azure CLI ? Finally, i go with this Dockerfile

To build it, it’s easy

To run it, it’s easy

As you can see i add -v /home/myaccount: /Data , this is because i want to share my home folder with the container.

Good luck.