市面上已有很多顶级Docker 图形界面管理工具,出于学习容器开发目的,计划动手写个简单的界面管理工具
使用 Go 和 Web 技术编写桌面应用的项目,类似于ElectronJS 。
官方网站 https://wails.io/zh-Hans/docs/introduction/
Docker本身采用Go编写,官网SDK如下
官方网站 https://docs.docker.com/engine/api/sdk/
开箱即用的高质量 Vue 组件,使用方便
官方网站 https://www.antdv.com/docs/vue/introduce-cn
项目地址 https://github.com/LeoBest2/my-docker-gui
JS异步处理问题:
版本1中调用的ContainerStop
是异步执行的,调用最后的handleRefresh
刷新界面时实际执行的容器可能操作没完成,导致界面操作完成后不变参考: https://blog.csdn.net/weixin_39629679/article/details/111261923 修改为版本2得以解决
版本1
版本2
总代码
刷新容器 启动容器 停止容器 删除容器 selectedRows = _selectedRows }"row-key="ID" :columns="columns" :data-source="data" :scroll="{ x: 'max-content' }">{{ name.substring(1) }} {{ record.State }} {{ port.IP }}:{{ port.PublicPort }}->{{ port.PrivatePort }}/{{ port.Type }}