Idea部署远程Docker并配置文件(idea基于docker环境)

admin 241 2022-07-13

阿里云服务器优惠多,折扣错,惊喜多,请咨询:www.wqiis.com

1.修改linux服务器docker配置文件

vim /usr/lib/systemd/system/docker.service

Idea部署远程Docker并配置文件(idea基于docker环境)

添加配置

ExecStart=/usr/bin/dockerd

-H fd:// --containerd=/run/containerd/containerd.sock

-H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock

重启docker

systemctl daemon-reload

systemctl restart docker

2.Idea下载docker插件

3.修改项目pom文件

org.springframework.boot spring-boot-maven-plugin 2.4.1 true true com.Main8090 repackage com.spotify docker-maven-plugin 1.0.0 build-image package build idea2021test latest ${project.basedir} http://101.200.201.196:2375 / ${project.build.directory} ${project.build.finalName}.jar

4.打包、build

---> Running in 0ff0ece2e746 Removing intermediate container 0ff0ece2e746  ---> 76846947b2eb Step 4/4 : ENTRYPOINT ["java","-jar","/app.jar"]

---> Running in fac72c653afd Removing intermediate container fac72c653afd  ---> f7866a998d4e ProgressMessage{id=null, status=null, stream=null, error=null, progress=null, progressDetail=null} Successfully built f7866a998d4e Successfully tagged idea2021test:latest [INFO] Built idea2021test [INFO] Tagging idea2021test with latest [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time:  01:43 min [INFO] Finished at: 2021-06-17T21:02:25+08:00

表示build成功

5.创建容器

6.配置映射端口

7.运行

上一篇:选择海外云服务器平台介绍(海外云服务器推荐)
下一篇:了解云堡垒机资产数是什么?有什么应用价值?(根据云堡垒机支持资产数量和并发量的不同)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~