<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Docker Maven Plugin管理 Docker 容器

          聯(lián)合創(chuàng)作 · 2023-09-27 14:41

          docker maven plugin 是個簡單的可以管理Docker容器maven插件,這個插件將會根據(jù)你的配置,在構(gòu)建時啟動容器,構(gòu)建結(jié)束時停止容器并刪除,如果本地找不到鏡像,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>
          
          瀏覽 25
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  亚洲小说区图片区 | 一级片视频在线播放 | 亚人精品中文字幕在线观看 | 3344在线观看免费下载视频 | 成人精品视频99在线观看免费 |