进入Linux服务器
 vim /lib/systemd/system/docker.service
 
将 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
替换为 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
 
新建文件
Dockerfile
 

配置Dockerfile文件
FROM openjdk:8
# Set the working directory
WORKDIR /demo
# Copy the JAR file to the image
COPY ./target/file-server-images.jar /demo/file-server-images1.jar
# Define the command to run the JAR file
CMD ["java", "-jar", "file-server-images1.jar"]
# Expose the port the app runs on
EXPOSE 80
 
yml 保持端口号一致
server:
  port: 80
 
添加 在 标签下面 要求 二个名称一致
        <finalName>file-server-images</finalName>
 

 
在Dockerfile文件右键 选择MRC
 
 填写这四个
 
 端口号
 
 配置打包
 
 成功
 



















