I want to download the Docker Toolbox on my 2017 Macbook Pro with High Sierra. I went to the Docker Toolbox website and downloaded it. I then ran the docker quick install terminal from the installer and then it started running and getting docker and the vm machine on my Macbook Pro. There are two separate implementations of TRIM in Docker for Mac: one for Docker.qcow2 and one for Docker.raw. On High Sierra running on an SSD, the default filesystem is APFS and we use Docker.raw by default. This is because APFS supports an API for deallocating blocks from inside a file, while HFS+ does not.
So, you’ve decided to try something new today and started a project from scratch. Your first step will be to set up a development environment: at the bare minimum, you’d want to run a web server and a PHP interpreter (preferably – with the debugging engine installed).
With Docker, you can start developing, running, and debugging your code in a matter of minutes!
Probably the easiest way to integrate Docker with PhpStorm is to use the PhpStorm Docker registry. It provides a selection of preconfigured Docker images curated by the PhpStorm team, which cover the most common PHP development needs.
Before you proceed, make sure that you have Docker installed on your machine: see how to do it on Windows and on macOS.
Defining the environment
To get started, we create a new project in PhpStorm. Next, we create a new file named docker-compose.yml , which will describe the configuration of the services comprising our app. In our case, it will be a single webserver service:
2 4 6 8 10 | services: image: phpstorm/php-71-apache-xdebug-26 -'80:80' -./:/var/www/html XDEBUG_CONFIG: remote_host=host.docker.internal |
As you can see, we use the preconfigured Docker image comprising the Apache web server and PHP 7.1 with Xdebug.
Note that we use the host.docker.internal value to refer to the remote host. In Docker for Windows and Docker for Mac, it automatically resolves to the internal address of the host, letting you easily connect to it from the container.
An important note for Linux users: host.docker.internal on Linux is currently not supported. You’ll have to use your local machine’s hostname instead (to find out what your machine’s hostname is, simply execute hostname in Terminal).
The corresponding environment configuration section for Linux will read as follows:
If you’d like to learn more about Docker and how to use it in PhpStorm, make sure to check out the excellent tutorial series by Pascal Landau, and PhpStorm documentation, of course.
Your JetBrains PhpStorm Team
The Drive to Develop
The Drive to Develop