Enabling Docker Remote Access, Configuring IDEA Docker Plugin, and Deploying a Spring Boot Eureka Server with Maven
This tutorial walks through enabling Docker remote connections on Linux and Windows, installing and configuring the IntelliJ IDEA Docker plugin, adding a docker‑maven‑plugin to a Spring Boot Eureka project, building Docker images, creating containers with port mapping, and setting up one‑click deployment for rapid backend development.
Hi, I am a senior architect. This guide shows how to enable Docker remote access, configure the IntelliJ IDEA Docker plugin, and deploy a Spring Boot Eureka server using Maven.
1. Enable Docker Remote Access
Linux : Edit /usr/lib/systemd/system/docker.service and add the listening address -H tcp://0.0.0.0:2375 to the ExecStart line, then reload and restart Docker:
systemctl daemon-reload
systemctl start dockerIf a firewall is enabled, add a rule to allow traffic on port 2375 or disable the firewall.
Windows : Right‑click the Docker icon → Settings → General and check “Expose daemon on tcp://localhost:2375 without TLS”. No restart is required.
2. Install and Configure IDEA Docker Plugin
In File → Settings → Plugins search for “Docker”, install it, and restart IDEA.
Then go to File → Settings → Build, Execution, Deployment → Docker , click “+” to add a new Docker instance, and set the Engine API URL to the host IP and port (e.g., http://127.0.0.1:2375 ). Click “Test Connection” – a successful message confirms the setup.
3. Create a Spring Boot Eureka Project
Create a new project via File → New → Project → Spring Initializr and choose a simple Eureka server.
3.1 Add docker‑maven‑plugin to pom.xml
<!-- Use docker-maven-plugin -->
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<imageName>${project.artifactId}</imageName>
<imageTags>
<imageTag>latest</imageTag>
</imageTags>
<dockerDirectory>${project.basedir}/src/main/resources</dockerDirectory>
<dockerHost>http://127.0.0.1:2375</dockerHost>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>3.2 Dockerfile
FROM java:8
VOLUME /tmp
ADD *.jar app.jar
EXPOSE 9090
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]If the java:8 image is not present locally, pull it first with docker pull java:8 .
4. Build Image and Verify
Run mvn package . The plugin builds the Docker image named after the project (e.g., eurekaserver:latest ). You can see the image in the IDEA Docker tool window and in the Docker CLI.
5. Create and Run Container
In the Docker tool window, right‑click the newly built image and select “Create container”. Set the container name and map ports, for example 127.0.0.1:8080:9090 . Click “Run”. The container starts, exposing the Eureka server on host port 8080.
Access the service via http://127.0.0.1:8080 – you should see the Eureka dashboard, confirming a successful deployment.
6. One‑Click Deployment
To rebuild the image automatically on each run, edit the run configuration:
In “Before launch”, add a new “Run Maven Goal” with the goal package .
Save the configuration. Now each time you start the container from IDEA, Maven packages the project, the docker‑maven‑plugin builds a fresh image, and the container is launched.
7. Environment Requirements
JDK 1.8 or higher, Maven 3.2+, Docker installed and reachable via the configured TCP endpoint.
References: cnblogs tutorial , Spring Boot Docker guide .
Top Architect
Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.