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)
Mysql5.7.19 version is a new version launched thi...
1. Environment: MySQL-5.0.41-win32 Windows XP Pro...
Preparation: 192.168.16.128 192.168.16.129 Two vi...
Table of contents Installation package download I...
Table of contents Write in front Business code us...
Table of contents Preface question principle test...
I will be learning MySQL next semester. I didn...
Table of contents 1. Implementation of counter 2....
This article example shares the specific code of ...
Table of contents First install wget View Help Ma...
Many times, we ignore the setting of the web page ...
1. Install dependency packages [root@localhost ~]...
For any DBMS, indexes are the most important fact...
step Place the prepared static resource files in ...
Overview: The filesystem module is a simple wrapp...