docker构建镜像方式--2--docker-maven-plugin 插件 ,远程连接docker服务器,一键快速生成镜像 【个人不推荐】
2024-12-26 20:35
docker maven plugin 是个简单的可以管理Docker容器maven插件,这个插件将会根据你的配置,在构建时启动容器,构建结束时停止容器并删除,如果本地找不到镜像,Docker会自动去中央仓库下载。
简单示例:
com.ofbizian
docker-maven-plugin
1.0.0
busybox
start-docker
pre-integration-test
start
所有可能配置的完整示例:
com.ofbizian
docker-maven-plugin
1.0.0
http://localhost:4243
dockerfile/redis
<![CDATA[
{"Hostname":"",
"PortSpecs":null,
"User":"",
"Tty":false,
"OpenStdin":false,
"StdinOnce":false,
"Memory":0,
"MemorySwap":0,
"CpuShares":0,
"AttachStdin":false,
"AttachStdout":false,
"AttachStderr":false,
"Env":null,
"Cmd":null,
"Dns":null,
"Volumes":null,
"VolumesFrom":"",
"Entrypoint":[
],
"NetworkDisabled":false,
"Privileged":false,
"WorkingDir":"",
"Domainname":"",
"ExposedPorts":null,
"OnBuild":null}
]]>
<![CDATA[
{"ContainerIDFile": null, "LxcConf": null, "Links": null, "PortBindings": {
"6379/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "6379"
}
]
}, "Privileged": false, "PublishAllPorts": false}
]]>
busybox
start-docker
pre-integration-test
start
stop-docker
post-integration-test
stop