Features Plugins

What does IntelliJ IDEA 2017.3 have in store for Docker support?

In IntelliJ IDEA 2017.3 the Docker integration has had a lot of changes made to it, both big and small. What does this really entail though? Let’s find out!

First of all, there are improvements to the Run/Debug Configurations dialog. Now you have the choice of three types of Docker Run Configurations:

  • Docker Image
  • Dockerfile
  • Docker-compose

DockerRunDebugConfiguration

Create Docker Configuration dialog

The Create Docker Configuration dialog has also been redesigned. One of the goals of this rework was to make it possible to accept the CLI arguments directly, without converting the docker run command into a JSON file.

At the moment we don’t cover 100% of all of the docker arguments, but if you are missing support for any of the docker run options, add a comment to this issue IDEA-181088 or create a new issue, and we will try and get it supported, as soon as possible.

Now, with the Docker plugin you can not only use environment variables, but also files with environment variables to run a Docker container. Add files with environment variables to the command line options field, in the Create Docker Configuration dialog. With this new feature there is no need to learn the new syntax — You can just refer to the file with `--env-file production.env` like you would normally do in the CLI.

Screen Shot 2017-11-15 at 14.46.26

Dockerfile

A new Build Image action was added to the gutter for the Dockerfile.

Screen Shot 2017-11-17 at 16.22.04

The Docker plugin now supports the Dockerfile with custom names.

Screen Shot 2017-11-08 at 19.30.43

In order to start using this new feature: add the files that will be used as Dockerfiles, to the Docker Recognized File Type in the Preferences | Editor | File Types .

Screen Shot 2017-11-08 at 19.03.32

With the Docker plugin you can select a dockerfile from the dropdown list in the Run/Debug Configurations.

Screen Shot 2017-11-15 at 14.57.49

Another improvement we made for working with dockerfiles, is that the docker plugin can set environment variables in the container during the docker build.

The Stopped Containers and Untagged Images filters are now available from the Filter icon in the gutter of the Docker Tool Window.

Screen Shot 2017-11-08 at 09.35.04

Last but not least, there is now the support for alternative names for the docker-compose.yml files. Another enhancement to this is the ability to use docker-compose.yml files from any folder, not just the project folder.

Please take into account that the Docker plugin is not bundled yet, and in order to test the new functionality, you need to update this plugin.

We hope you find this new functionality awesome. Give the new features a try and share your feedback with us here in the comments, in our issue tracker, or on Twitter.

Happy Developing!

 

image description