亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

怎么把spring boot應用發布到Harbor

發布時間:2021-02-02 13:58:00 來源:億速云 閱讀:287 作者:小新 欄目:編程語言

小編給大家分享一下怎么把spring boot應用發布到Harbor,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

settings.xml配置

<server>
   <id>docker-hub</id>
   <username>admin</username>
   <password>Harbor12345</password>
  </server>

pom.xml配置

</parent>
    <groupId>com.topcheer</groupId>
    <artifactId>docker</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>docker</name>
    <description>Demo project for Spring Boot</description>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <docker.image.prefix>topcheer</docker.image.prefix>
    <docker.repostory>192.168.180.105:1180</docker.repostory>
  </properties>

  <dependencies>
  

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <repositories>
    <repository>
      <id>spring-milestones</id>
      <name>Spring Milestones</name>
      <url>https://repo.spring.io/milestone</url>
    </repository>
  </repositories>
  

   <build>
    <finalName>docker</finalName>
    <plugins>
      <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
      <!--加入下面兩項配置-->
      <executions>
       <execution>
        <goals>
         <goal>repackage</goal>
        </goals>
       </execution>
      </executions>
      <configuration>
         <includeSystemScope>true</includeSystemScope>
      </configuration>
   </plugin>
      <plugin>
        <groupId>com.spotify</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>1.2.0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
          <execution>
            <id>tag-image</id>
            <phase>package</phase>
            <goals>
              <goal>tag</goal>
            </goals>
            <configuration>
              <image>${docker.repostory}/${docker.image.prefix}/${project.artifactId}:1.0.1</image>
              <newName>${docker.repostory}/${docker.image.prefix}/${project.artifactId}:1.0.1</newName>
            </configuration>
          </execution>
          <execution>
            <id>push-image</id>
            <phase>deploy</phase>
            <goals>
              <goal>push</goal>
            </goals>
            <configuration>
              <imageName>${docker.repostory}/${docker.image.prefix}/${project.artifactId}:1.0.1</imageName>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <serverId>docker-hub</serverId>
          <registryUrl>${docker.repostory}</registryUrl>
          <dockerHost>http://192.168.180.105:2375</dockerHost>
          <forceTags>true</forceTags>
          <pushImage>true</pushImage>
          <dockerDirectory>src/main/docker</dockerDirectory>
          <imageName>${docker.repostory}/${docker.image.prefix}/${project.artifactId}:1.0.1</imageName>
          <imageTags>
            <imageTag>1.0.2</imageTag>
          </imageTags>
          <resources>
            <rescource>
              <targetPath></targetPath>
              <directory>${project.build.directory}</directory>
              <include>${project.build.finalName}.jar</include>
            </rescource>
          </resources>
          <includeSystemScope>true</includeSystemScope>
        </configuration>
      </plugin>
    </plugins>
  </build>

運行命令

clean package docker:build -DpushImage -Dmaven.test.skip=true

怎么把spring boot應用發布到Harbor

看完了這篇文章,相信你對“怎么把spring boot應用發布到Harbor”有了一定的了解,如果想了解更多相關知識,歡迎關注億速云行業資訊頻道,感謝各位的閱讀!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

泰兴市| 长汀县| 西昌市| 松溪县| 岑巩县| 渭南市| 雅江县| 克东县| 天气| 瓮安县| 玉环县| 大安市| 乌苏市| 汉川市| 文化| 广河县| 伊通| 隆子县| 沛县| 沅江市| 富阳市| 壤塘县| 馆陶县| 高州市| 凤庆县| 米脂县| 阿拉善盟| 徐汇区| 吐鲁番市| 延寿县| 辉县市| 宁海县| 天津市| 乌审旗| 秦安县| 洪雅县| 鄱阳县| 沧州市| 灵台县| 长丰县| 平果县|