mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2024-12-22 04:47:11 +08:00
build(Dockerfile): 更新构建镜像jdk8 → jdk17
This commit is contained in:
parent
888ab6e61e
commit
09359627a0
@ -1,6 +1,30 @@
|
||||
FROM openjdk:8-jdk-alpine
|
||||
# 基础镜像
|
||||
FROM openjdk:17-jdk-alpine
|
||||
|
||||
# 维护者信息
|
||||
MAINTAINER youlai <youlaitech@163.com>
|
||||
|
||||
RUN echo "https://mirrors.ustc.edu.cn/alpine/v3.7/main/" > /etc/apk/repositories && \
|
||||
apk --no-cache add tzdata && \
|
||||
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||
echo "Asia/Shanghai" > /etc/timezone
|
||||
|
||||
# /tmp 目录作为容器数据卷目录,SpringBoot内嵌Tomcat容器默认使用/tmp作为工作目录,任何向 /tmp 中写入的信息不会记录进容器存储层
|
||||
# 在宿主机的/var/lib/docker目录下创建一个临时文件并把它链接到容器中的/tmp目录
|
||||
VOLUME /tmp
|
||||
ADD target/oms-boot.jar mall-oms.jar
|
||||
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/mall-oms.jar"]
|
||||
EXPOSE 8603
|
||||
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \&& echo 'Asia/Shanghai' >/etc/timezone
|
||||
|
||||
# 复制主机文件至镜像内,复制的目录需放置在 Dockerfile 文件同级目录下
|
||||
ADD target/oms-boot.jar app.jar
|
||||
|
||||
# 容器启动执行命令
|
||||
CMD java \
|
||||
-Xms128m \
|
||||
-Xmx128m \
|
||||
-Djava.security.egd=file:/dev/./urandom \
|
||||
-jar /app.jar
|
||||
|
||||
# 声明容器提供服务端口
|
||||
EXPOSE 8803
|
||||
|
||||
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:8-jre
|
||||
FROM openjdk:17-jdk-alpine
|
||||
|
||||
# 维护者信息
|
||||
MAINTAINER youlai <youlaitech@163.com>
|
||||
|
||||
# 设置容器时区为当前时区
|
||||
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \&& echo 'Asia/Shanghai' >/etc/timezone
|
||||
RUN echo "https://mirrors.ustc.edu.cn/alpine/v3.7/main/" > /etc/apk/repositories && \
|
||||
apk --no-cache add tzdata && \
|
||||
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||
echo "Asia/Shanghai" > /etc/timezone
|
||||
|
||||
# /tmp 目录作为容器数据卷目录,SpringBoot内嵌Tomcat容器默认使用/tmp作为工作目录,任何向 /tmp 中写入的信息不会记录进容器存储层,从而保证容器存储层的无状态化
|
||||
# /tmp 目录作为容器数据卷目录,SpringBoot内嵌Tomcat容器默认使用/tmp作为工作目录,任何向 /tmp 中写入的信息不会记录进容器存储层
|
||||
# 在宿主机的/var/lib/docker目录下创建一个临时文件并把它链接到容器中的/tmp目录
|
||||
VOLUME /tmp
|
||||
|
||||
@ -15,9 +17,13 @@ VOLUME /tmp
|
||||
ADD target/pms-boot.jar app.jar
|
||||
|
||||
# 容器启动执行命令
|
||||
ENTRYPOINT ["java", "-Xmx128m", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/app.jar"]
|
||||
CMD java \
|
||||
-Xms128m \
|
||||
-Xmx128m \
|
||||
-Djava.security.egd=file:/dev/./urandom \
|
||||
-jar /app.jar
|
||||
|
||||
# 声明运行时容器提供服务端口,仅仅是声明
|
||||
# 声明容器提供服务端口
|
||||
EXPOSE 8802
|
||||
|
||||
|
||||
|
@ -1,17 +1,29 @@
|
||||
FROM openjdk:8-jre
|
||||
MAINTAINER youlai youlaitech@163.com
|
||||
# 基础镜像
|
||||
FROM openjdk:17-jdk-alpine
|
||||
|
||||
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \&& echo 'Asia/Shanghai' >/etc/timezone
|
||||
# 维护者信息
|
||||
MAINTAINER youlai <youlaitech@163.com>
|
||||
|
||||
# /tmp 目录作为容器数据卷目录,SpringBoot内嵌Tomcat容器默认使用/tmp作为工作目录,任何向 /tmp 中写入的信息不会记录进容器存储层,从而保证容器存储层的无状态化
|
||||
RUN echo "https://mirrors.ustc.edu.cn/alpine/v3.7/main/" > /etc/apk/repositories && \
|
||||
apk --no-cache add tzdata && \
|
||||
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||
echo "Asia/Shanghai" > /etc/timezone
|
||||
|
||||
# /tmp 目录作为容器数据卷目录,SpringBoot内嵌Tomcat容器默认使用/tmp作为工作目录,任何向 /tmp 中写入的信息不会记录进容器存储层
|
||||
# 在宿主机的/var/lib/docker目录下创建一个临时文件并把它链接到容器中的/tmp目录
|
||||
VOLUME /tmp
|
||||
|
||||
# 复制jar到镜像
|
||||
# 复制主机文件至镜像内,复制的目录需放置在 Dockerfile 文件同级目录下
|
||||
ADD target/sms-boot.jar app.jar
|
||||
|
||||
ENTRYPOINT ["java", "-Xmx128m", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/app.jar"]
|
||||
# 容器启动执行命令
|
||||
CMD java \
|
||||
-Xms128m \
|
||||
-Xmx128m \
|
||||
-Djava.security.egd=file:/dev/./urandom \
|
||||
-jar /app.jar
|
||||
|
||||
# 声明容器提供服务端口
|
||||
EXPOSE 8804
|
||||
|
||||
|
||||
|
@ -1,12 +1,30 @@
|
||||
FROM openjdk:8-jre
|
||||
MAINTAINER youlai youlaitech@163.com
|
||||
# 基础镜像
|
||||
FROM openjdk:17-jdk-alpine
|
||||
|
||||
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \&& echo 'Asia/Shanghai' >/etc/timezone
|
||||
# 维护者信息
|
||||
MAINTAINER youlai <youlaitech@163.com>
|
||||
|
||||
RUN echo "https://mirrors.ustc.edu.cn/alpine/v3.7/main/" > /etc/apk/repositories && \
|
||||
apk --no-cache add tzdata && \
|
||||
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||
echo "Asia/Shanghai" > /etc/timezone
|
||||
|
||||
# /tmp 目录作为容器数据卷目录,SpringBoot内嵌Tomcat容器默认使用/tmp作为工作目录,任何向 /tmp 中写入的信息不会记录进容器存储层
|
||||
# 在宿主机的/var/lib/docker目录下创建一个临时文件并把它链接到容器中的/tmp目录
|
||||
VOLUME /tmp
|
||||
|
||||
ADD target/ums-boot.jar mall-ums.jar
|
||||
# 复制主机文件至镜像内,复制的目录需放置在 Dockerfile 文件同级目录下
|
||||
ADD target/ums-boot.jar app.jar
|
||||
|
||||
# 容器启动执行命令
|
||||
CMD java \
|
||||
-Xms128m \
|
||||
-Xmx128m \
|
||||
-Djava.security.egd=file:/dev/./urandom \
|
||||
-jar /app.jar
|
||||
|
||||
# 声明容器提供服务端口
|
||||
EXPOSE 8801
|
||||
|
||||
|
||||
ENTRYPOINT ["java", "-Xmx128m", "-Djava.security.egd=file:/dev/./urandom","-jar","/mall-ums.jar"]
|
||||
|
||||
EXPOSE 8601
|
||||
|
@ -1,7 +1,13 @@
|
||||
FROM openjdk:8-jre
|
||||
FROM openjdk:17-jdk-alpine
|
||||
MAINTAINER youlai youlaitech@163.com
|
||||
|
||||
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \&& echo 'Asia/Shanghai' >/etc/timezone
|
||||
# 设置国内镜像源(中国科技大学镜像源),修改容器时区(alpine镜像需安装tzdata来设置时区),安装字体库(验证码)
|
||||
RUN echo "https://mirrors.ustc.edu.cn/alpine/v3.7/main/" > /etc/apk/repositories && \
|
||||
apk --no-cache add tzdata && \
|
||||
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||
echo "Asia/Shanghai" > /etc/timezone && \
|
||||
apk --no-cache add ttf-dejavu fontconfig
|
||||
|
||||
|
||||
# /tmp 目录作为容器数据卷目录,SpringBoot内嵌Tomcat容器默认使用/tmp作为工作目录,任何向 /tmp 中写入的信息不会记录进容器存储层,从而保证容器存储层的无状态化
|
||||
# 在宿主机的/var/lib/docker目录下创建一个临时文件并把它链接到容器中的/tmp目录
|
||||
@ -10,9 +16,14 @@ VOLUME /tmp
|
||||
# 复制jar到镜像
|
||||
ADD target/youlai-auth.jar app.jar
|
||||
|
||||
ENTRYPOINT ["java", "-Xmx128m", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/app.jar"]
|
||||
# 指定容器启动时执行的命令
|
||||
CMD java \
|
||||
-Xms128m \
|
||||
-Xmx128m \
|
||||
-Djava.security.egd=file:/dev/./urandom \
|
||||
-jar /app.jar
|
||||
|
||||
EXPOSE 8000
|
||||
EXPOSE 9000
|
||||
|
||||
|
||||
|
||||
|
@ -1,8 +1,11 @@
|
||||
FROM openjdk:8-jre
|
||||
FROM openjdk:17-jdk-alpine
|
||||
MAINTAINER youlai youlaitech@163.com
|
||||
|
||||
|
||||
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \&& echo 'Asia/Shanghai' >/etc/timezone
|
||||
# 设置国内镜像源(中国科技大学镜像源),修改容器时区(alpine镜像需安装tzdata来设置时区)
|
||||
RUN echo "https://mirrors.ustc.edu.cn/alpine/v3.7/main/" > /etc/apk/repositories && \
|
||||
apk --no-cache add tzdata && \
|
||||
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||
echo "Asia/Shanghai" > /etc/timezone
|
||||
|
||||
# /tmp 目录作为容器数据卷目录,SpringBoot内嵌Tomcat容器默认使用/tmp作为工作目录,任何向 /tmp 中写入的信息不会记录进容器存储层,从而保证容器存储层的无状态化
|
||||
# 在宿主机的/var/lib/docker目录下创建一个临时文件并把它链接到容器中的/tmp目录
|
||||
@ -11,7 +14,11 @@ VOLUME /tmp
|
||||
# 复制jar至镜像
|
||||
ADD target/youlai-gateway.jar app.jar
|
||||
|
||||
ENTRYPOINT ["java", "-Xmx128m", "-Djava.security.egd=file:/dev/./urandom","-Dcsp.sentinel.app.type=1", "-jar", "/app.jar"]
|
||||
CMD java \
|
||||
-Xms128m \
|
||||
-Xmx128m \
|
||||
-Djava.security.egd=file:/dev/./urandom \
|
||||
-jar /app.jar
|
||||
|
||||
EXPOSE 9999
|
||||
|
||||
|
@ -1,11 +1,13 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:8-jre
|
||||
FROM openjdk:17-jdk-alpine
|
||||
|
||||
# 维护者信息
|
||||
MAINTAINER youlai <youlaitech@163.com>
|
||||
|
||||
# 设置容器时区为当前时区
|
||||
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \&& echo 'Asia/Shanghai' >/etc/timezone
|
||||
RUN echo "https://mirrors.ustc.edu.cn/alpine/v3.7/main/" > /etc/apk/repositories && \
|
||||
apk --no-cache add tzdata && \
|
||||
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||
echo "Asia/Shanghai" > /etc/timezone
|
||||
|
||||
# /tmp 目录作为容器数据卷目录,SpringBoot内嵌Tomcat容器默认使用/tmp作为工作目录,任何向 /tmp 中写入的信息不会记录进容器存储层
|
||||
# 在宿主机的/var/lib/docker目录下创建一个临时文件并把它链接到容器中的/tmp目录
|
||||
@ -15,7 +17,11 @@ VOLUME /tmp
|
||||
ADD target/system-boot.jar app.jar
|
||||
|
||||
# 容器启动执行命令
|
||||
ENTRYPOINT ["java", "-Xmx128m", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/app.jar"]
|
||||
CMD java \
|
||||
-Xms128m \
|
||||
-Xmx128m \
|
||||
-Djava.security.egd=file:/dev/./urandom \
|
||||
-jar /app.jar
|
||||
|
||||
# 声明容器提供服务端口
|
||||
EXPOSE 8800
|
||||
|
Loading…
Reference in New Issue
Block a user