Home > Java > javaTutorial > How to run springboot project with Linux Docker

How to run springboot project with Linux Docker

WBOY
Release: 2023-05-21 10:28:11
forward
1271 people have browsed it

1: We must first have a running docker environment

Step one: Use yum to install (under centos 7)

docker requires the kernel version of the centos system Above 3.10, check the prerequisites on this page to verify whether your centos version supports docker.

Check your current kernel version through the uname -r command

Step 2: Install docker

docker software package and dependency packages are already included in the default centos-extras software source. The installation command is as follows:

Installation completed.

Step 3: Start docker background service

Step 4: Test run hello-world

Because there is no local Hello-world is the image, so a hello-world image will be downloaded and run in the container. Now let's start using it for real.

Two: Let’s start configuring our own docker springboot

Step 1: Create an operating account to run docker Newly added - has nothing to do with the content of the following documents【Operation generally cannot be done with root

The second step: start the operation and maintenance of docker

1. Run mvn install The project is packaged into a jar package
2. Copy the jar package to the currently created folder, and the dockerfile file to a folder

3: Build our springboot project to docker and generate a docker image

3. Enter the folder and run the command with or without version. It will be different! ! !

Linux Docker怎么运行springboot项目

With the image generated by v1.0, I ran the wrong command like this:

Linux Docker怎么运行springboot项目

Four: Run the springboot project in docker

Five: See if our interface can be used

Linux Docker怎么运行springboot项目

The above is the detailed content of How to run springboot project with Linux Docker. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template