您的位置:首页 > 教育 > 培训 > idea连接docker 自动化部署

idea连接docker 自动化部署

2024/10/6 19:27:45 来源:https://blog.csdn.net/weixin_46597615/article/details/142338501  浏览:    关键词:idea连接docker 自动化部署

进入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
在这里插入图片描述
填写这四个
在这里插入图片描述
端口号
在这里插入图片描述
配置打包
在这里插入图片描述
成功
在这里插入图片描述

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com