返回
热门搜索

Idea部署远程Docker并配置文件

IT博客 数学 动态规划 点击量 541

基本信息 收藏 - 举报 - 海报

详细介绍

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

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

添加配置

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.运行

到此这篇关于Idea配置Docker 远程部署的文章就介绍到这了,更多相关idea部署远程docker内容请搜索IT博客社区以前的文章或继续浏览下面的相关文章希望大家以后多多支持IT博客社区!

没有更多内容。

用户评价(0)

好评度100%
  • 还没有人评论此条信息!
+ 加载更多

联系方式

提示:联系我时,请说明在巅云php学苑看到的,谢谢!
  • 联系人:
  • 地  区:
  • 电  话: 共发布信息(2004)条 所在地:未填写
看了又看
加载中
首页 首页 收藏 收藏

电话联系