* **在maven中引用完了docker插件之后,它为我们提供了以下命令:**
*****
构建镜像
```
dockerfile:build
```
镜像打标签
```
dockerfile:tag
```
发布镜像到私服
```
dockerfile:push
```
命令帮助
```
dockerfile:help
```
*****
* **本地打包,构建镜像并发布到私服**
在pom所在的文件夹下执行:
```
mvn clean package dockerfile:build dockerfile:push
```
![](https://img.kancloud.cn/df/3a/df3a28a355b06a6c9ddd74255cd8af7c_1920x1048.png)
![](https://img.kancloud.cn/fb/24/fb249f5ecc7a89281483e7073247e2ef_1920x1048.png)
直到命令运行结束,我们去私服看如下图,证明我们发布成功
![](https://img.kancloud.cn/c4/b3/c4b36228e082e5d4b83ef31e2944ce3d_1334x728.png)