Loading... ## 1. 创建Dockerfile文件 ``` FROM openjdk:8-jdk-alpine VOLUME /tmp ADD eureka-server-0.0.1-SNAPSHOT.jar app.jar RUN sh -c 'touch /app.jar' RUN echo "Asia/Shanghai" > /etc/timezone ENV JAVA_OPTS="" ENTRYPOINT ["sh", "-c","java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar -XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError -Xms512M -Xmx1G /app.jar"] ``` ## 2. 打包镜像 将打包好的jar包和dockerfile文件放到同一目录下 ```bash docker build -t eureka:1.0 . ``` 然后静待打包完成 ![打包完成.png](https://old.qwq.ro/usr/uploads/2022/06/2801315534.png) 打包完成后运行容器 ```bash docker run -ldt --name eureka --privileged=true -d -p 9510:9510 -v /opt/eureka/config:/config eureka:1.0 ``` Last modification:June 27, 2022 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 0 感谢大佬投喂 啾咪~
2 comments
大佬请问您博客的服务器状态栏怎么做的,我做了它的图标会错位呢?https://www.linkkk.top
您好 现在您的博客打不开 如果需要帮助的话请联系我的微信 NekoPunchQAQ