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

Details about the like operator in MySQL

1. Introduction When filtering unknown or partial...

Why should MySQL fields use NOT NULL?

I recently joined a new company and found some mi...

Testing of hyperlink opening target

The target attribute of a link determines where th...

How to view the execution time of SQL statements in MySQL

Table of contents 1. Initial SQL Preparation 2. M...

Summary of js execution context and scope

Table of contents Preface text 1. Concepts relate...

js realizes the magnifying glass function of shopping website

This article shares the specific code of js to re...

Promise encapsulation wx.request method

The previous article introduced the implementatio...

MySQL 5.7.21 Installer Installation Graphic Tutorial under Windows 10

Install MySQL and keep a note. I don’t know if it...

How does Vue solve the cross-domain problem of axios request front end

Table of contents Preface 1. Why do cross-domain ...

Solution for installing opencv 3.2.0 in Ubuntu 18.04

Download opencv.zip Install the dependencies ahea...

MySQL installation tutorial under Windows with pictures and text

MySQL installation instructions MySQL is a relati...

Vue implements the function of calling the mobile phone camera and album

This article shares the specific code of Vue to a...

Vue3.0+vite2 implements dynamic asynchronous component lazy loading

Table of contents Create a Vite project Creating ...

Install CentOS 7 on VMware14 Graphic Tutorial

Introduction to CentOS CentOS is an enterprise-cl...

Sliding menu implemented with CSS3

Result:Implementation code: <!DOCTYPE html>...