Skip to content

Commit

Permalink
add gradle docker plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
yangziwen committed Aug 31, 2018
1 parent 4e87c36 commit 303ee97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
* 支持配置用户访问文件权限、文件传输限速等,详情[请见配置](https://github.com/yangziwen/zy-ftp/blob/master/conf/server.config)
* 不加密的传输方式下支持主动、被动模式
* 加密的传输方式下(FTP over TLS),仅支持被动模式
* docker运行的情况下,仅支持被动模式
* 运行于docker环境时,仅支持被动模式

#### 打包 & 运行
* 基于jar包运行
1. 打包代码:`mvn package` or `gradle build`
2. 启动服务:`java -jar zy-ftp.jar -c ${config_file_path}`
* 基于docker运行
1. 制作镜像:`mvn package dockerfile:build`
1. 制作镜像:`mvn package dockerfile:build` or `gradle dockerBuild`
2. 启动容器:
```
docker run -d \
Expand Down
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
apply plugin: "java"
plugins {
id "java"
id "org.sglahn.gradle-dockerfile-plugin" version "0.5"
}

repositories {
mavenCentral()
Expand Down Expand Up @@ -39,4 +42,9 @@ task copyJar(type: Copy, dependsOn: build) {
rename("zy-ftp-${version}.jar", "zy-ftp.jar")
}

docker {
tags = [version]
}

build.finalizedBy copyJar
dockerBuild.dependsOn copyJar

0 comments on commit 303ee97

Please sign in to comment.