Configuring Remote Interpreters via Docker
Prerequisites
-
Before you start working with Docker, make sure that the Docker integration plugin is enabled. The plugin is bundled with RubyMine and is activated by default. If the plugin is not activated, enable it on the Plugins page of the Settings / Preferences Dialog as described in Enabling and Disabling Plugins.
-
Before you start working with Docker, make sure that the Ruby Docker plugin is enabled. The plugin is bundled with RubyMine and is activated by default. If the plugin is not activated, enable it on the Plugins page of the Settings / Preferences Dialog as described in Enabling and Disabling Plugins.
Limitation
As of this writing, on Windows and MacOS platforms running, debugging and profiling applications is only possible for the projects residing in the user home directory. If necessary, configure other directories in the VirtualBox settings.
Docker Machine on Linux does not share user home folder, and any other folders as well. Thus, for running, debugging and profiling applications, the user should add shared folders with the project sources to the VirtualBox Docker virtual machine manually. These shared folders on VM should be mapped one to one to the folders on the host Linux machine, i.e. (host) /home/user <=> /home/user
(VM) or (host) /home/my/project <=> /home/my/project
(VM)
Configuring remote interpreter using Docker
To set up a Ruby interpreter inside a Docker container for your project, follow these steps:
- In the Project Interpreter page of the Settings/Preferences dialog box, click , and then choose Add Remote.
- From the Configure Remote Ruby Interpreter dialog box that opens, choose the option Docker:
- If the required Docker machine is not available, click New, and in the dialog box that opens, specify the machine name, API URL, and the certificates folder.
If you want to import credentials of an existing Docker machine, select the corresponding check box.
The configured remote interpreter is set as the project interpreter. Now you can run, debug and profile your application using Ruby inside a Docker container.