Docker Maven Plugin

程序名称:Docker Maven Plugin

授权协议: MIT

操作系统: 跨平台

开发语言: Java

Docker Maven Plugin 介绍

docker maven plugin
是个简单的可以管理Docker容器maven插件,这个插件将会根据你的配置,在构建时启动容器,构建结束时停止容器并删除,如果本地找不到镜像,Docker会自动去中央仓库下载。

简单示例:

<plugin>
    <groupId>com.ofbizian</groupId>
    <artifactId>docker-maven-plugin</artifactId>
    <version>1.0.0</version>
    <configuration>
        <images>
            <image>
                <name>busybox</name>
            </image>
        </images>
    </configuration>
    <executions>
        <execution>
            <id>start-docker</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>start</goal>
            </goals>
        </execution>
    </executions>
</plugin>

所有可能配置的完整示例:

<plugin>
    <groupId>com.ofbizian</groupId>
    <artifactId>docker-maven-plugin</artifactId>
    <version>1.0.0</version>
    <configuration>
        <dockerUrl>http://localhost:4243</dockerUrl>
        <images>
            <image>
                <name>dockerfile/redis</name>
                <containerConfig>
                    <![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}
                    ]]>
                </containerConfig>
                <hostConfig>
                    <![CDATA[
                    {"ContainerIDFile": null, "LxcConf": null, "Links": null, "PortBindings": {
                        "6379/tcp": [
                            {
                                "HostIp": "0.0.0.0",
                                "HostPort": "6379"
                            }
                        ]
                    }, "Privileged": false, "PublishAllPorts": false}
                    ]]>
                </hostConfig>
            </image>
            <image>
                <name>busybox</name>
            </image>
        </images>
    </configuration>
    <executions>
        <execution>
            <id>start-docker</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>start</goal>
            </goals>
        </execution>
        <execution>
            <id>stop-docker</id>
            <phase>post-integration-test</phase>
            <goals>
                <goal>stop</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Docker Maven Plugin 官网

https://github.com/bibryam/docker-maven-plugin

相关编程语言

Cyclone是一个打造容器工作流的云原生持续集成持续发...
Kui Shell 为构建云原生应用程序提供了新的开发经验...
Eclipse MicroProfile 是一个 Java 微服务开发的基础...
Kabanero 构建在 Knative、Istio 与 Tekton 之上,提...
Antrea 是一个 Kubernetes 网络解决方案,旨在实现 ...
Linkerd 是一个提供弹性云端原生应用服务网格(serv...