Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Icon

Docker is an open platform for building, shipping and running distributed applications. It gives programmers, development teams and operations engineers the common toolbox they need to take advantage of the distributed and networked nature of modern applications.

This tutorial describes Docker support in PhpStorm.

Prerequisites

Docker installation

First of all, you'll need to install Docker and related tools so that you can take advantage of the Docker integration in PhpStorm. Please refer to the Docker documentation to get more information about the installation process:

Docker integration plugin installation

You will also need to install the plugin in PhpStorm. Open Settings (Preferences) | Plugins, and click the Install JetBrains plugin... button:

Search for Docker and install the Docker Integration plugin by using the context menu.


Restart the IDE to complete the installation of the plugin.

PhpStorm & Docker Integration Configuration

At this point you have Docker and Docker plugin for PhpStorm installed, so we can start with integration configuration.

Launching default docker machine and getting necessary parameters

  1. Open the "Docker Quickstart Terminal"
  2. Docker will launch a default VM providing output in the console:
     
  3. Run docker-machine env default to get necessary parameters, as we'll need them later for configuration of the PhpStorm (such as DOCKER_HOST and DOCKER_CERT_PATH):

Configuring PhpStorm to work with Docker

  1. Open Settings / Preferences | Build, Execution, Deployment | Clouds and create Docker configuration with a + button:

  2. You need to provide the configuration name (Docker in our case), API URL (https://192.168.99.100:2376 in our case, taken from the previous step console output, please note the protocol change), Certificates folder (/Users/mikhailvink/.docker/machine/machines/default in our case):
     

    Icon

    Please note that you might need to provide a socket path in the API URL field on Linux machines instead of the URL (usually it's unix:///var/run/docker.sock):

  3. Apply the configuration and close the Settings / Preferences dialog.
  4. Create a new Docker Deployment Run/Debug Configuration invoking the dialog from the Run | Edit configurations... menu:


 

 


  • No labels