Cloud Native 10 min read

Enabling Docker Remote Access, Configuring IDEA Docker Plugin, and Deploying a Spring Boot Eureka Server

This tutorial walks through setting up Docker's remote API, installing and configuring the IDEA Docker plugin, creating a Spring Boot Eureka project, adding the docker‑maven‑plugin, building a Docker image, and running the container with one‑click deployment for Java backend services.

Java Architect Essentials
Java Architect Essentials
Java Architect Essentials
Enabling Docker Remote Access, Configuring IDEA Docker Plugin, and Deploying a Spring Boot Eureka Server

Environment : JDK 1.8+, Maven 3.2+, IntelliJ IDEA, Docker.

Enable Docker remote access (Linux) :

1. Edit docker.service (e.g., vi /usr/lib/systemd/system/docker.service ) and add -H tcp://0.0.0.0:2375 to the ExecStart line.

2. Reload and restart Docker:

systemctl daemon-reload
systemctl start docker

3. Adjust firewall rules if needed.

Enable Docker remote access (Windows) :

In Docker Desktop settings → General, check Expose daemon on tcp://localhost:2375 without TLS .

Install and configure IDEA Docker plugin :

1. Open File → Settings → Plugins , search for "Docker", install and restart IDEA.

2. In File → Settings → Build, Execution, Deployment → Docker , add a new Docker configuration, set the Engine API URL to the Docker host (e.g., http://127.0.0.1:2375 ), and verify the connection.

Create a simple Eureka project (Spring Initializr) and open it in IDEA.

Configure the project :

1. Add docker-maven-plugin to <plugins> in pom.xml (example configuration shown below).

<!--使用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>

2. Update application.properties with server port, Eureka settings, etc.

3. Add @EnableEurekaServer annotation to the Spring Boot main class.

Add a Dockerfile (place under src/main/resources ):

FROM java:8
VOLUME /tmp
ADD *.jar app.jar
EXPOSE 9090
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/app.jar"]

If the base image java:8 is missing, pull it with docker pull java:8 .

Build the image by running mvn package ; the plugin will use the Dockerfile to create an image named eurekaserver:latest .

Create and run the container :

In the IDEA Docker tool window, right‑click the newly built image, choose "Create container", set container name and port binding (e.g., 127.0.0.1:8080:9090 ), then click Run.

Access the service at http://127.0.0.1:8080 to verify the Eureka server is up.

One‑click deployment :

Configure the run configuration to execute Maven package before launch (Activate tool window → Run Maven Goal → package ). After this, each run will rebuild the image and start the container automatically.

With these steps, you have a fully automated workflow to develop, build, and deploy a Spring Boot Eureka service inside Docker directly from IntelliJ IDEA.

JavaDockerMavenContainerizationSpring BootEurekaIDEA plugin
Java Architect Essentials
Written by

Java Architect Essentials

Committed to sharing quality articles and tutorials to help Java programmers progress from junior to mid-level to senior architect. We curate high-quality learning resources, interview questions, videos, and projects from across the internet to help you systematically improve your Java architecture skills. Follow and reply '1024' to get Java programming resources. Learn together, grow together.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.