Docker Support in IntelliJ IDEA 14.1
As developers, we can all agree that shipping code should be easy. Whether deploying to a local testing or staging server, our laptop, or a Unix box halfway around the world, builds should be portable, predictable and (mostly) painless. But sometimes it seems like shipping code is half the battle – we spend countless hours configuring the infrastructure instead of delivering critical updates to our users. Docker is one solution to this problem, and now on IntelliJ IDEA 14.1, shipping code with Docker has never been easier.
With the new Docker plugin for IntelliJ IDEA, you can add Docker support to existing projects, deploy artifacts to a Docker host, view logs, and manage Docker containers from right inside IntelliJ IDEA. When you’re ready to connect to Docker, simply add a new Docker configuration under Cloud settings. The Docker platform offers many useful PaaS features and can serve as a kind of hosted cloud, with a remote API, SSH support, and commands for installing, configuring and managing changes to your application infrastructure.
There is a new Run/Debug Configuration for Docker deployments, which will allow you to specify the cloud deployment target, an appropriate Dockerfile, and give your Container a name. To create a new Container settings file, first select, “Save container settings sample” and indicate a destination, where the Docker plugin will create a default host configuration file (these settings are user-modifiable). While remote debugging assistance is not currently supported, you can assign a debugging port and copy/paste the arguments directly onto the Docker command line for remote debugging over JDWP.
From the Application Servers tool window, it’s easy to inspect containers and view running processes. You can also search through logs, start and stop containers, and perform basic container management like creating and deleting containers. Each deployment in Docker is assigned a unique container ID – these are initially temporary containers, although they can be committed and saved for further distribution. On the Docker Hub registry, there are many such images available for you to try.
Images in Docker are read-only – once committed, any changes to a container’s state will become part of a new image. When you have a stable build on one instance of Docker (on your development machine, staging server, or a cloud), reproducing the exact same build is as simple as (1) committing the Docker container, (2) pushing it to a registry (public or private), then (3) pulling the same image to another instance of Docker, running – wherever. This version control aspect is part of what makes Docker such a powerful tool for developers.
Docker support is still under development. To show your support, try a preview, and report any issues you may encounter, please refer to IDEA-133511. We look forward to hearing your feedback!
Update: Docker Integration is now available from the plugin repository.