/DockDockBuild

Support for running UNIX Makefiles on a Docker container

Primary LanguageKotlinOtherNOASSERTION

DockDockBuild: Docker Based Makefile Support for IntelliJ-Based IDEs

DockDockBuild is an open source plugin for IntelliJ that dockerizes your makefile compilation.

logo Downloads Build codecov Version

When compiling a target in a makefile, this plugin builds a docker container and runs the compilation in that container. The container shares the host's code root path by using Docker's volume mapping, making the compiled code available and persistent.

DockDockBuild allows developers to compile their project on an immutable, uniform environment, without dedicated installations on their machine - just Docker.

This plugin fully supports GNU Make syntax, and provides:

  • Syntax highlighting
  • Run configurations
  • Gutter marks & context actions to run targets
  • and more

Based on https://plugins.jetbrains.com/plugin/9333-makefile-support

Prerequisites

  1. Docker - see installation instructions for Mac, Windows and Ubuntu.

    Please note that in some cases, it is recommended that Mac and Windows users install Docker Toolbox rather than Docker Desktop, as the latter might cause compatibility issues with Hyper-V - read more here.

  2. IntelliJ 2021.2 and above - if you have an older version, download the latest one here. It is recommended to uninstall the old version silently, so that you don't lose your old configuration.

Installation

From the IntelliJ Plugin Marketplace

In Settings, click on Plugins. You will find DockDockBuild in the Marketplace tab. Click on Install.

You may be required to restart your IDE following the installation.

From zip

Just drag-and-drop the file on top of IntelliJ and it will be installed.
Alternatively, go to Plugins -> Settings and select Install Plugin From Disk: Install plugin from zip

Select the zip file, and then click on Install.

You may be required to restart your IDE following the installation.

Configuration

Plugin Configuration

This is done automatically, but if you use non default values, you will need to define the paths to your Docker executable, code root and Maven cache, for example:

Docker Desktop for Mac: plugin_config

Set the Path to Docker executable to be the location of the docker executable file on your machine.

Set the Path to code root to be the location of your project's source code root folder.

Set the Path to Maven cache as the location of your .m2 folder.

Optionally: Set the Advanced docker settings with additional settings for the docker run command (mount additional volumes, etc.).

Run Configuration

DockDockBuild's run configuration is where you can select which Makefile and Dockerfile are used for building your project, as well as define environment variables.

When compiling a specific target from your Makefile, a default Run Configuration is set and used instantly by DockDockBuild, based on the location of the Makefile and the target being compiled.

You may also define multiple run configurations manually, and select which one to use each time you compile a target.

run config.jpg

  • Name your configuration.
  • Select the local Dockerfile or Docker image you would like to use.
  • Select the Makefile you would like to run.
  • Specify the target to be built.
  • [OPTIONAL] Select a script to be run on the container before the make command, that sets environment variables, runs installations etc.

Additional Configuration for Docker-Toolbox Users

Here

Usage

There are multiple ways to build your project using DockDockBuild:

  1. Select a run configuration from the drop-down list and click on the "play" button. select_run_config.png
  2. Go to your Makefile, and click on the "play" button next to the relevant target. run_from_file.png

Contribution

We welcome contributions from everyone. Please refer to the documentation here for more info.