Detailed tutorial on how to publish springboot projects through docker plug-in in IDEA

Detailed tutorial on how to publish springboot projects through docker plug-in in IDEA

1. Write the Dockerfile

(1) Right-click the project name, create a new text file, and change the name to Dockerfile without the suffix. Place it in the project root directory.

(2) Fill in the Dockerfile content

FROM openjdk:8
 
VOLUME /tmp
ADD target/*.jar app.jar
 
ENTRYPOINT ["java","-jar","/app.jar"]

FROM openjdk:8 // indicates that the basic environment is jdk8
ADD target/*.jar app.jar //Copy the files matching *.jar in the target folder in the same directory to app.jar and put them in the image

ENTRYPOINT ["java","-jar","/app.jar"] // Execute the jar command to run the project

2. Edit project configuration through docker plug-in

(1) Find the configuration page

Run -> Edit Configuration

Click the + sign to add a new configuration and select Dockerfile for Docker

(2) Edit configuration

3. Release the image and generate the container

(1) Click the Servers tab

<1> Shortcut key alt+8 (8 on the main keyboard)

<2> Top menu -> View -> Tool Window -> Servers

<3> Place the mouse on the icon in the lower left corner for a while

(2) Publish via button

Summarize

This is the end of this article about the detailed tutorial on how to publish springboot projects in IDEA through the docker plug-in. For more information about how to publish springboot projects in IDEA, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • The whole process of IDEA integrating docker to deploy springboot project
  • How to configure docker in IDEA2021.2 to image the springboot project and release it with one click
  • Detailed steps to deploy SpringBoot projects using Docker in Idea
  • Deploy the springboot project to docker based on idea
  • Detailed explanation of the process of deploying SpringBoot project through Docker plug-in in IDEA

<<:  Vue uses plug-ins to cut pictures in proportion

>>:  Causes and solutions for MySQL deadlock

Recommend

Detailed explanation of MySQL 5.7.9 shutdown syntax example

mysql-5.7.9 finally provides shutdown syntax: Pre...

jQuery realizes the shuttle box function

This article example shares the specific code of ...

How to deploy SpringBoot project using Dockerfile

1. Create a SpringBooot project and package it in...

Detailed explanation of MySQL master-slave database construction method

This article describes how to build a MySQL maste...

When the interviewer asked the difference between char and varchar in mysql

Table of contents Difference between char and var...

Zookeeper unauthorized access test problem

Table of contents Preface Detect Zookeeper servic...

Detailed installation instructions for the cloud server pagoda panel

Table of contents 0x01. Install the Pagoda Panel ...

How to implement remote access control in Centos 7.4

1. SSH remote management SSH is a secure channel ...

MySQL 8.0.11 MacOS 10.13 installation and configuration method graphic tutorial

The process of installing MySQL database and conf...

WeChat applet realizes taking photos and selecting pictures from albums

This article shares the specific code for WeChat ...

In-depth explanation of MySQL user account management and permission management

Preface The MySQL permission table is loaded into...

JavaScript Basics Operators

Table of contents 1. Operators Summarize 1. Opera...