3 Star 0 Fork 0

Gitee 极速下载/docker-maven-plugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/bibryam/docker-maven-plugin
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Maven plugin for Docker

This plugin allows managing multiple Docker containers from a maven build process.

###Prerequisites Locally running docker with TCP sockets enabled: On RHEL thats in /usr/lib/systemd/system/docker.service

ExecStart=/usr/bin/docker -d -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock

###Usage The start goal will create a container instance from an image and start it. If the image is not available locally, the plugin will pull the image from the internet.

The stop goal will stop the container instances and remove them from the local registry. The image will remain on the local repository.

If containers are not stopped explicitly using stop goal, the plugin by default will try to stop and delete all containers started from start goal. If you want to keep containers running after maven build has finished, use skipStop option to prevent stopping the containers.

containerConfig option allows configuring container creation parameters. hostConfig option allows configuring container start parameters.

###Examples Here is the simplest example to start a container from publicly available "busybox" image and stop it at the end of the build:

<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>

Next is a complete example with all the possible configurations:

<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>
The MIT License (MIT) Copyright (c) 2014 Bilgin Ibryam Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

docker maven plugin 是个简单的可以管理Docker容器maven插件,这个插件将会根据你的配置,在构建时启动容器,构建结束时停止容器并删除,如果本地找不到镜像, 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者

全部

语言

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/mirrors/docker-maven-plugin.git
git@gitee.com:mirrors/docker-maven-plugin.git
mirrors
docker-maven-plugin
docker-maven-plugin
master

搜索帮助