Server mode Docker packaging function migrated to the root directory (#1273)

* feat: Server mode Docker packaging function migrated to the root directory

* feat: Server mode Docker packaging function migrated to the root directory

* feat: remove comment

* feat: i18n
pull/1280/head
BigXin0109 2 years ago committed by GitHub
parent 0035e970dd
commit 9698d8d7d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

5
.gitignore vendored

@ -46,3 +46,8 @@ build/
docs/node_modules docs/node_modules
docs/build docs/build
docs/.docusaurus docs/.docusaurus
### Docker ###
docker/threadpool/conf
docker/threadpool/target

@ -34,10 +34,11 @@ hippo4j/hippo4j-server
方式一: 方式一:
```shell ```shell
# 进入到 hippo4j-server/hippo4j-bootstrap 工程路径下 # 进入到 threadpool/server/bootstrap 工程路径下
mvn clean package -Dskip.spotless.apply=true mvn clean package -Dskip.spotless.apply=true
# 进入到 docker/threadpool 工程路径下
# 默认打包是打包的 tag 是 latest # 默认打包是打包的 tag 是 latest
docker build -t hippo4j/hippo4j-server ../hippo4j-bootstrap docker build -t hippo4j/hippo4j-server ../threadpool
``` ```
方式二: 方式二:
@ -45,6 +46,6 @@ docker build -t hippo4j/hippo4j-server ../hippo4j-bootstrap
通过 `maven docker plugin` 通过 `maven docker plugin`
```shell ```shell
# 进入到 hippo4j-server 工程路径下 # 进入到 threadpool/server/bootstrap 工程路径下
mvn clean package -DskipTests -Dskip.spotless.apply=true docker:build mvn clean package -DskipTests -Dskip.spotless.apply=true docker:build
``` ```

@ -34,10 +34,11 @@ hippo4j/hippo4j-server
方式一: 方式一:
```shell ```shell
# 进入到 hippo4j-server/hippo4j-bootstrap 工程路径下 # 进入到 threadpool/server/bootstrap 工程路径下
mvn clean package -Dskip.spotless.apply=true mvn clean package -Dskip.spotless.apply=true
# 进入到 docker/threadpool 工程路径下
# 默认打包是打包的 tag 是 latest # 默认打包是打包的 tag 是 latest
docker build -t hippo4j/hippo4j-server ../hippo4j-bootstrap docker build -t hippo4j/hippo4j-server ../threadpool
``` ```
方式二: 方式二:
@ -45,6 +46,6 @@ docker build -t hippo4j/hippo4j-server ../hippo4j-bootstrap
通过 `maven docker plugin` 通过 `maven docker plugin`
```shell ```shell
# 进入到 hippo4j-server 工程路径下 # 进入到 threadpool/server/bootstrap 工程路径下
mvn clean package -DskipTests -Dskip.spotless.apply=true docker:build mvn clean package -DskipTests -Dskip.spotless.apply=true docker:build
``` ```

@ -11,6 +11,7 @@
<properties> <properties>
<maven.deploy.skip>true</maven.deploy.skip> <maven.deploy.skip>true</maven.deploy.skip>
<contextDir>${project.parent.parent.parent.basedir}/docker/threadpool</contextDir>
</properties> </properties>
<dependencies> <dependencies>
@ -58,20 +59,70 @@
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>com.spotify</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>docker-maven-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>1.2.2</version> <executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>../../../docker/threadpool/conf/</outputDirectory>
<resources>
<resource>
<directory>conf</directory>
<includes>
<include>hippo4j-logback.xml</include>
<include>application.properties</include>
<include>application-h2.properties</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-build</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration> <configuration>
<imageName>hippo4j-server:${project.version}</imageName> <encoding>UTF-8</encoding>
<dockerDirectory>${project.basedir}</dockerDirectory> <outputDirectory>../../../docker/threadpool/target</outputDirectory>
<resources> <resources>
<resource> <resource>
<targetPath>/</targetPath> <directory>target</directory>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource> </resource>
</resources> </resources>
</configuration> </configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.42.1</version>
<configuration>
<images>
<image>
<name>hippo4j/${project.build.finalName}:${project.version}</name>
<alias>${project.build.finalName}</alias>
<build>
<contextDir>${contextDir}</contextDir>
</build>
</image>
<image>
<name>hippo4j/${project.build.finalName}:latest</name>
<alias>${project.build.finalName}</alias>
<build>
<contextDir>${contextDir}</contextDir>
</build>
</image>
</images>
</configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

Loading…
Cancel
Save