eureka: 1. Build a JDK imageStart the eureka container Prepare the jdk folder and all required files mkdir ~/jdk cd ~/jdk #Upload jdk compressed file to /root/jdk/ directory# Pre-class materials/docker/tomcat7/jdk....gz # Create Dockerfile vim Dockerfile Copy the following content java -jar a.jar --server.port=80 --spring.profiles.active=a FROM centos:7 ADD jdk-8u212-linux-x64.tar.gz /opt/ ENV JAVA_HOME=/opt/jdk1.8.0_212 PATH=/opt/jdk1.8.0_212/bin:$PATH ENTRYPOINT bash Build: docker build -t jdk:8 . docker images 2. Build the eureka imagePrepare the eureka folder mkdir ~/eureka cd ~/eureka Upload the eureka jar file to the /root/eureka directory Pre-course materials/DevOps pre-course materials/Kubernetes/K8s case/v2/eureka/eureka....jar Create Dockerfile vim Dockerfile Copy the following content into Dockerfile FROM jdk:8 COPY sp05-eureka-0.0.1-SNAPSHOT.jar /opt/ ENTRYPOINT ["java", "-jar", "/opt/sp05-eureka-0.0.1-SNAPSHOT.jar"] CMD ["--spring.profiles.active=eureka1", "--server.port=2001"] Execute the build: docker build -t eureka:v1 . docker images If there is an eureka container before, clean it up first: docker ps docker rm -f xxx xxx xx docker container prune Start the eureka container: docker run -d --name eureka1 \ -p 2001:2001 eureka:v1 Print log: docker logs eureka1 Test address: http://192.168.64.150:2001 This is the end of this article about how to configure eureka in docker. For more information about configuring eureka 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:
|
<<: Implementation of vertical centering with unknown height in CSS
>>: WeChat applet date and time component (year, month, day, hour, and minute)
First, the HTML code to embed the video in the pag...
What is a web page? The page displayed after the ...
Related articles: Beginners learn some HTML tags ...
<br />Previous article: Seven Principles of ...
Table of contents 1. Overview 2. Memory Managemen...
Introduction When writing SQL today, I encountere...
one, G:\MySQL\MySQL Server 5.7\bin> mysqld --i...
Create table & create index create table tbl1...
This article mainly introduces the Vue project. O...
1. Download Download mysql-5.7.19-linux-glibc2.12...
The ECS cloud server created by the historical Li...
1. Log in to the system and enter the directory: ...
Table of contents 1. Solution 1 (UDF) Demo Case 2...
background Before starting the article, let’s bri...
Copy code The code is as follows: <iframe src=...