You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
842 B
Docker

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#指定基础镜像(一般指定程序所依赖的环境)
#本例子是构建SpringBoot,所以指定的jdk环境变量
FROM openjdk:17
#添加维护者信息
MAINTAINER author:chenyuepan
MAINTAINER mail:3158614516@qq.com
#将./hello-world.jar添加到容器的/opt目录中
COPY ./venue_reservation_service-0.0.1-SNAPSHOT.jar /opt
#指定dockerfile的命令在哪个目录下执行
WORKDIR /opt
#指定容器和外界交互的端口
EXPOSE 9020
#容器运行后执行的命令(该命令在WORKDIR指定的工作目录下执行)
#注意多个CMD指令只有最后一个会生效
CMD java -jar venue_reservation_service-0.0.1-SNAPSHOT.jar
#在构建镜像时执行的命令
#我这边用它来打印java的环境变量
RUN java -version
#添加该镜像的元数据
LABEL version="1.0" description="这是一个Web服务器" by="edc"