idea打包docker镜像

通过idea的docker插件,打包docker镜像到本地虚拟机

1.idea安装docker插件(一般默认安装)
file -> setting -> plugins

2.添加docker配置
可以通过windows本地docker环境,也可以通过SSH连接虚拟机环境,本文章演示的是通过SSH连接本地虚拟机
file -> setting -> Build,Execution,Doployment - > Docker
创建docker配置

创建SSH连接

测试连接

注:如果idea是2024以上版本,报错:dockerfile运行报错Cannot run program "docker.exe"
需要在windows环境下手动下载配置docker.exe

教程:https://blog.csdn.net/weixin_51623642/article/details/143742092

3.编写Dockerfile文件并执行

4.查看镜像
登录本地虚拟机,docker images查看镜像

5.上传/下载镜像到阿里云私有厂库
上传
docker login --username=[username] xxx.aliyuncs.com
docker tag [ImageId] xxx.aliyuncs.com/xxx/xxx:test
docker push xxx.aliyuncs.com/xxx/xxx:test

下载
docker pull xxx.aliyuncs.com/xxx/xxx:test

posted @ 2025-04-30 10:05  GT。  阅读(329)  评论(0)    收藏  举报