Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mikite
spring-boot-examples
提交
4fdf113b
S
spring-boot-examples
项目概览
Mikite
/
spring-boot-examples
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-boot-examples
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4fdf113b
编写于
3月 13, 2018
作者:
微笑很纯洁
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
m
上级
b8c27a44
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
116 addition
and
2 deletion
+116
-2
README.md
README.md
+2
-0
README_EN.md
README_EN.md
+1
-1
spring-boot-docker/pom.xml
spring-boot-docker/pom.xml
+66
-0
spring-boot-docker/src/main/docker/Dockerfile
spring-boot-docker/src/main/docker/Dockerfile
+4
-0
spring-boot-docker/src/main/java/com/neo/DockerApplication.java
...-boot-docker/src/main/java/com/neo/DockerApplication.java
+12
-0
spring-boot-docker/src/main/java/com/neo/controller/DockerController.java
...er/src/main/java/com/neo/controller/DockerController.java
+13
-0
spring-boot-docker/src/main/resources/application.properties
spring-boot-docker/src/main/resources/application.properties
+0
-0
spring-boot-docker/src/test/java/com/neo/DockerApplicationTests.java
...-docker/src/test/java/com/neo/DockerApplicationTests.java
+18
-0
spring-boot-hello/pom.xml
spring-boot-hello/pom.xml
+0
-1
未找到文件。
README.md
浏览文件 @
4fdf113b
...
...
@@ -15,6 +15,8 @@ Spring Boot使用的各种示例,以最简单、最实用为标准
-
[
spring-boot-hello
](
https://github.com/ityouknow/spring-boot-examples/tree/master/spring-boot-hello
)
:Spring Boot 2.0 Hello World 示例
-
[
spring-boot-banner
](
https://github.com/ityouknow/spring-boot-examples/tree/master/spring-boot-banner
)
:Spring Boot 定制 Banner 示例
-
[
spring-boot-docker
](
https://github.com/ityouknow/spring-boot-examples/tree/master/spring-boot-banner
)
:使用 Docker 部署 Spring Boot 示例
**参考文章**
...
...
README_EN.md
浏览文件 @
4fdf113b
...
...
@@ -14,7 +14,7 @@ Spring Boot Examples, Use the simplest and most useful scene demo.
-
[
spring-boot-hello
](
https://github.com/ityouknow/spring-boot-examples/tree/master/spring-boot-hello
)
:Spring Boot 2.0 Hello World Demo
-
[
spring-boot-banner
](
https://github.com/ityouknow/spring-boot-examples/tree/master/spring-boot-banner
)
:Spring Boot Customized Banner
-
[
spring-boot-docker
](
https://github.com/ityouknow/spring-boot-examples/tree/master/spring-boot-banner
)
:Spring Boot with Docker
---
...
...
spring-boot-docker/pom.xml
0 → 100644
浏览文件 @
4fdf113b
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.neo
</groupId>
<artifactId>
spring-boot-docker
</artifactId>
<version>
1.0
</version>
<packaging>
jar
</packaging>
<name>
spring-boot-docker
</name>
<description>
Demo project for Spring Boot
</description>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.0.0.RELEASE
</version>
</parent>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<java.version>
1.8
</java.version>
<docker.image.prefix>
springboot
</docker.image.prefix>
</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>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
<!-- Docker maven plugin -->
<plugin>
<groupId>
com.spotify
</groupId>
<artifactId>
docker-maven-plugin
</artifactId>
<version>
1.0.0
</version>
<configuration>
<imageName>
${docker.image.prefix}/${project.artifactId}
</imageName>
<dockerDirectory>
src/main/docker
</dockerDirectory>
<resources>
<resource>
<targetPath>
/
</targetPath>
<directory>
${project.build.directory}
</directory>
<include>
${project.build.finalName}.jar
</include>
</resource>
</resources>
</configuration>
</plugin>
<!-- Docker maven plugin -->
</plugins>
</build>
</project>
spring-boot-docker/src/main/docker/Dockerfile
0 → 100644
浏览文件 @
4fdf113b
FROM
openjdk:8-jdk-alpine
VOLUME
/tmp
ADD
spring-boot-docker-1.0.jar app.jar
ENTRYPOINT
["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
\ No newline at end of file
spring-boot-docker/src/main/java/com/neo/DockerApplication.java
0 → 100644
浏览文件 @
4fdf113b
package
com.neo
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
DockerApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
DockerApplication
.
class
,
args
);
}
}
spring-boot-docker/src/main/java/com/neo/controller/DockerController.java
0 → 100644
浏览文件 @
4fdf113b
package
com.neo.controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
public
class
DockerController
{
@RequestMapping
(
"/"
)
public
String
index
()
{
return
"Hello Docker!"
;
}
}
\ No newline at end of file
spring-boot-docker/src/main/resources/application.properties
0 → 100644
浏览文件 @
4fdf113b
spring-boot-docker/src/test/java/com/neo/DockerApplicationTests.java
0 → 100644
浏览文件 @
4fdf113b
package
com.neo
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
DockerApplicationTests
{
@Test
public
void
contextLoads
()
{
System
.
out
.
println
(
"hello docker"
);
}
}
spring-boot-hello/pom.xml
浏览文件 @
4fdf113b
...
...
@@ -20,7 +20,6 @@
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<java.version>
1.8
</java.version>
<docker.image.prefix>
springboot
</docker.image.prefix>
</properties>
<dependencies>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录