How to install openjdk in docker and run the jar package

How to install openjdk in docker and run the jar package

Download image

docker pull openjdk

Creating a Data Volume

Create a java_app data volume

docker volume create java_app

Upload jar package to /var/lib/docker/volumes/java_app/_data/ and start the image

Start the image

docker run --name=javaApp --restart=always --network=host \
 -v java_app:/usr/src/myapp openjdk java -jar /usr/src/myapp/jar package

For example

docker run -it -d --network=host --restart=always --name=autoRefreshCSDN -v java_app:/usr/src/myapp openjdk java -jar /usr/src/myapp/autoRefreshCSDN-1.0-SNAPSHOT-jar-with-dependencies.jar

This is the end of this article about how to install openjdk in docker and run the jar package. For more information about running jar packages in docker, 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:
  • OpenJDK source code debugging tutorial
  • How to replace OpenJDK with Oracle JDK in Kylin V10
  • Docker solves the problem that JDK's jmap and other commands cannot be used in openjdk containers
  • Differences between openjdk and Oraclejdk
  • How to uninstall Linux's native openjdk and install sun jdk
  • How to easily compile openJDK in Ubuntu
  • Compilation details based on the compiled virtual machine jvm-openjdk
  • A quick solution to the problem of being unable to uninstall after installing openJDK1.8 with yum
  • How to install Java openjdk on CentOS system
  • Detailed explanation of System.out.println in OpenJDK source code analysis

<<:  Vue implements the browser-side code scanning function

>>:  HTML table markup tutorial (29): cell light border color attribute BORDERCOLORLIGHT

Recommend

Native JS to implement drag position preview

This article shares with you a small Demo that ad...

Detailed explanation of the failure of MySQL to use UNION to connect two queries

Overview UNION The connection data set keyword ca...

Solve the problem of Navicat for Mysql connection error 1251 (connection failed)

Because what I wrote before was not detailed enou...

Solution to MySQL master-slave delay problem

Today we will look at why master-slave delay occu...

Learn about JavaScript closure functions in one article

Table of contents Variable Scope The concept of c...

Summary of practical experience of HTML knowledge points

1. The table tag is table, tr is row, td is cell, ...

VMware Workstation 14 Pro installation and activation graphic tutorial

This article shares the installation and activati...

Detailed explanation of MySQL data rows and row overflow mechanism

1. What are the formats of lines? You can see you...

mysql 8.0.19 winx64.zip installation tutorial

This article records the installation tutorial of...

Explanation of the working mechanism of namenode and secondarynamenode in Hadoop

1) Process 2) FSImage and Edits Nodenode is the b...

Example code for implementing raindrop animation effect with CSS

Glass Windows What we are going to achieve today ...

Complete steps to use element in vue3.0

Preface: Use the element framework in vue3.0, bec...

How to use VLAN tagged Ethernet card in CentOS/RHEL system

In some scenarios, we want to assign multiple IPs...