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 1 year 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/build
docs/.docusaurus
### Docker ###
docker/threadpool/conf
docker/threadpool/target

@ -34,10 +34,11 @@ hippo4j/hippo4j-server
方式一:
```shell
# 进入到 hippo4j-server/hippo4j-bootstrap 工程路径下
# 进入到 threadpool/server/bootstrap 工程路径下
mvn clean package -Dskip.spotless.apply=true
# 进入到 docker/threadpool 工程路径下
# 默认打包是打包的 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`
```shell
# 进入到 hippo4j-server 工程路径下
# 进入到 threadpool/server/bootstrap 工程路径下
mvn clean package -DskipTests -Dskip.spotless.apply=true docker:build
```

@ -34,10 +34,11 @@ hippo4j/hippo4j-server
方式一:
```shell
# 进入到 hippo4j-server/hippo4j-bootstrap 工程路径下
# 进入到 threadpool/server/bootstrap 工程路径下
mvn clean package -Dskip.spotless.apply=true
# 进入到 docker/threadpool 工程路径下
# 默认打包是打包的 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`
```shell
# 进入到 hippo4j-server 工程路径下
# 进入到 threadpool/server/bootstrap 工程路径下
mvn clean package -DskipTests -Dskip.spotless.apply=true docker:build
```

@ -11,6 +11,7 @@
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<contextDir>${project.parent.parent.parent.basedir}/docker/threadpool</contextDir>
</properties>
<dependencies>
@ -58,19 +59,69 @@
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<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>
<encoding>UTF-8</encoding>
<outputDirectory>../../../docker/threadpool/target</outputDirectory>
<resources>
<resource>
<directory>target</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.2.2</version>
<version>0.42.1</version>
<configuration>
<imageName>hippo4j-server:${project.version}</imageName>
<dockerDirectory>${project.basedir}</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
<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>
</plugins>

Loading…
Cancel
Save