WebStorm 2017.1 Help

Run/Debug Configuration: Docker Deployment

Run | Edit Configurations | /help/img/idea/2017.1/new.png | Docker Deployment


Docker Deployment run/debug configurations let you download and build Docker images, and create and start Docker containers.

To make Docker Deployment run/debug configurations available, you must download and install the Docker integration plugin, see Installing, Updating and Uninstalling Repository Plugins.

See also, Docker.

Name, Share, and Single instance only

Item Description
Name The name of the run configuration.
Share Select this check box to share the run configuration through version control.

If the check box is not selected, the run configuration settings are stored in .idea/workspace.xml.

If the check box is selected, the settings are stored in a separate .xml file in .idea/runConfigurations or in the .ipr file.

Single instance only If you select this check box, only one instance of the run configuration will run at a time.

Deployment tab

ItemDescription
ServerSelect the Docker configuration to be used.

To create a new configuration, or to edit an existing one, click /help/img/idea/2017.1/browseButton.png (Shift+Enter). For more information, see Docker.

DeploymentOne of the following:
  • Docker Image. Select this option if you want to deploy a Docker image available locally.
  • <docker-dir>/Dockerfile. Select the Dockerfile to be used. (The Dockerfiles available in your project are suggested.)
  • <docker-dir>/docker-compose.yml. Select the Docker Compose YAML file to be used. (The docker-compose.yml files available in your project are suggested.)
The following settings are not available if a docker-compose.yml file is selected in the Deployment field.
Image IDIf Docker Image is selected in the Deployment field: the ID of the image to be deployed, a sequence of hexadecimal symbols. For the image of interest, you can, for example, use the Copy image ID command in the Docker tool window and then paste the ID into this field.
Image tagIf <docker-dir>/Dockerfile is selected in the Deployment field: if you want to use an image with a particular tag, specify that tag. (The image in this case is specified in the Dockerfile.) If nothing is specified, Docker will look for the image with the tag latest.
Container nameIf you want to give the container that will be created a particular name, specify that name. Otherwise, Docker will itself decide what the name should be.
After launchSelect this check box to start a web browser after starting the run/debug configuration.

Select the browser from the list. Click /help/img/idea/2017.1/browseButton.png (Shift+Enter) to configure your web browsers.

With JavaScript debugger If this check box is selected, the web browser is started with the JavaScript debugger enabled.

Note that JavaScript debugging is available only for Firefox and Google Chrome. When you debug your JavaScript in Firefox for the first time, the JetBrains Firefox extension is installed.

The field underneath After launch Specify the URL the browser should go to when started. In most typical cases, this URL corresponds to the root of your Web application or its starting page.
Debug PortThe port to be used for debugging. (Debugging is supported only for Java.) This may be any unused port on your computer.

If there is a warning Debug port forwarding not found, click Fix. As a result, the necessary port mapping info is added to the JSON container settings file.

Note the command line arguments suggested by WebStorm. To make debugging possible, these should be used to start the JVM in the container.

Container tab

This tab contains the settings for your container.

NOTE: The settings on this tab are ignored if a docker-compose.yml file is selected in the Deployment field.

ItemDescription
JSON filePath to a JSON file with container settings in the Docker Engine API format.
  • /help/img/idea/2017.1/browseButton.png lets you select an existing file.
  • /help/img/idea/2017.1/icon_importCopyrightProfile.png lets you generate and save a sample container settings .json file.

CLI lets you translate the docker run options into JSON container settings Docker Engine API format. The result is saved in a JSON file which is associated with your container.

(For docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
OPTIONS are specified in the CLI options field of the dialog that opens when you click CLI,
COMMAND is specified in the Command field,
ARG... part is specified in the Entrypoint or Command filed.)

The settings below the JSON file field take precedence when overlapping ones set in the JSON file.
EntrypointThe entry point for your container, see e.g. ENTRYPOINT(default command to execute at runtime) in Docker run reference.
CommandSee CMD (default command or options) in the Docker run reference.
Publish all ports If the check box is selected, all the container’s exposed ports are bound to a random host port.
See e.g. EXPOSE (incoming ports) in Docker run reference.
Port bindings Container port/protocol - Host IP address/port mappings.

E.g. 8080 tcp 127.0.0.1 18080 would bind the TCP port 8080 inside the container to port 18080 on the localhost or 127.0.0.1 interface on the host machine.

For more info, see e.g. Connect using network port mapping in Legacy container links.

LinksContainer name - alias mappings. See e.g. Communication across links in Legacy container links.
Volume bindingsVolume bindings such as container path - host path. See e.g. Manage data in containers.
Environment variablesEnvironment variables as variable - value pairs. See e.g. ENV (environment variables) in Docker run reference.

Before Launch options

Specify which tasks should be carried out before starting the run/debug configuration.

ItemShortcutDescription
/help/img/idea/2017.1/new.png Alt+Insert Click this icon to add a task to the list. Select the task to be added, for example:
  • Run External tool. Select this option to run an application which is external to WebStorm. In the dialog that opens, select the application or applications that should be run. If the necessary application is not defined in WebStorm yet, add its definition. For more information, see Configuring Third-Party Tools and External Tools.
  • Run Another Configuration. Select this option to execute another run/debug configuration. In the dialog that opens, select the configuration to be run.
  • Generate CoffeeScript Source Maps. Select this option to generate the source maps for your CoffeeScript sources. In the dialog that opens, specify where your CoffeeScript source files are located.

    For more information, see CoffeeScript.

  • Run Remote External Tool. Select this option to run a remote application which is external to WebStorm. In the dialog that opens, select one or more remote applications to be run. If the necessary applications are not defined in WebStorm yet, add their definitions. For more information, see Configuring Third-Party Tools and External Tools.
/help/img/idea/2017.1/delete.png Alt+Delete Click this icon to remove the selected task from the list.
/help/img/idea/2017.1/edit1.png EnterClick this icon to edit the selected task. Make the necessary changes in the dialog that opens.
/help/img/idea/2017.1/arrowUp.png /help/img/idea/2017.1/arrowDown.pngAlt+Up/Alt+DownClick these icons to move the selected task one line up or down in the list. (The tasks are performed in the order that they appear in the list.)
Show this pageSelect this check box to show the run/debug configuration settings prior to actually starting the run/debug configuration.
Activate tool window If this check box is selected, the Debug tool window opens when you start the run/debug configuration in the debug mode.

Otherwise, the tool window isn't shown. However, when the configuration is running in the debug mode, you can open the Debug tool window for it yourself if necessary.

Toolbar

ItemShortcutDescription
/help/img/idea/2017.1/new.pngAlt+InsertCreate a run/debug configuration.
/help/img/idea/2017.1/delete.pngAlt+DeleteDelete the selected run/debug configuration.
copyCtrl+DCreate a copy of the selected run/debug configuration.
/help/img/idea/2017.1/settings.pngView and edit the default settings for the selected run/debug configuration.
/help/img/idea/2017.1/arrowUp.png/help/img/idea/2017.1/arrowDown.pngAlt+Up/Alt+DownMove the selected run/debug configuration up and down in the list.

The order of configurations in the list defines the order in which the configurations appear in the corresponding list on the main toolbar.

/help/img/idea/2017.1/folder.pngYou can group run/debug configurations by placing them into folders.

To create a folder, select the configurations to be grouped and click /help/img/idea/2017.1/folder.png. Specify the name of the folder.

Then, to move a configuration into a folder, between the folders or out of a folder, use /help/img/idea/2017.1/arrowUp.png and /help/img/idea/2017.1/arrowDown.png. You can also drag a configuration into a folder.

To remove grouping, select a folder and click /help/img/idea/2017.1/delete.png.

See also, Creating Folders and Grouping Run/Debug Configurations.

See Also

Procedures:

Last modified: 17 July 2017