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
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
like you would normally do in the CLI.
A new Build Image action was added to the gutter for the Dockerfile.
The Docker plugin now supports the Dockerfile with custom names.
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 .
With the Docker plugin you can select a dockerfile from the dropdown list in the Run/Debug Configurations.
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.
Last but not least, there is now 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 so in order to test the new functionality, so don’t forget to update the plugin.