推送到 docker:
clean package docker:build -DpushImage
push过程中会报错,忽略之,docker中是可以启动成功的!错误信息如下:
......
[WARNING] Failed to push spring.io/docker.app, retrying in 10 seconds (5/5).
[INFO] Pushing spring.io/docker.app
The push refers to a repository [spring.io/docker.app]
b5e9a3e6075a: Preparing
08ba4e16adba: Preparing
162f935b1198: Preparing
dcf909146faa: Preparing
23b9c7b43573: Preparing
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:46 min
[INFO] Finished at: 2017-04-11T16:37:15+08:00
[INFO] Final Memory: 31M/75M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.11:build (default-cli) on project docker.app: Exception caught: Error: Status 405 trying to push repository docker.app: "" -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Process finished with exit code 1
检查镜像,发现 spring.io/docker.app 已经创建,启动 spring.boot项目 docker run -p 8080:8080 -t spring.io/docker.app 可以正常启动!
[iyunv@localhost frinder]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
spring.io/docker.app latest 93ab985f7835 18 minutes ago 195.3 MB
docker.io/centos latest a8493f5f50ff 4 days ago 192.5 MB
docker.io/frolvlad/alpine-oraclejdk8 slim 00d8610f052e 5 weeks ago 166.6 MB
[iyunv@localhost frinder]# docker run -p 8080:8080 -t spring.io/docker.app
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.2.RELEASE)
2017-04-11 08:43:59.100 INFO 6 --- [ main] com.s.b.d.App : Starting App v1.0-SNAPSHOT on 07a7a077770d with PID 6 (/app.jar started by root in /)
2017-04-11 08:43:59.109 INFO 6 --- [ main] com.s.b.d.App : No active profile set, falling back to default profiles: default
2017-04-11 08:43:59.283 INFO 6 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4b9af9a9: startup date [Tue Apr 11 08:43:59 GMT 2017]; root of context hierarchy
2017-04-11 08:44:01.873 INFO 6 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2017-04-11 08:44:01.905 INFO 6 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2017-04-11 08:44:01.908 INFO 6 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.11
2017-04-11 08:44:02.097 INFO 6 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2017-04-11 08:44:02.098 INFO 6 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2826 ms
2017-04-11 08:44:02.322 INFO 6 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2017-04-11 08:44:02.334 INFO 6 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2017-04-11 08:44:02.336 INFO 6 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2017-04-11 08:44:02.336 INFO 6 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2017-04-11 08:44:02.336 INFO 6 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2017-04-11 08:44:02.822 INFO 6 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4b9af9a9: startup date [Tue Apr 11 08:43:59 GMT 2017]; root of context hierarchy
2017-04-11 08:44:03.006 INFO 6 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2017-04-11 08:44:03.008 INFO 6 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2017-04-11 08:44:03.066 INFO 6 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-04-11 08:44:03.066 INFO 6 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-04-11 08:44:03.150 INFO 6 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-04-11 08:44:03.191 INFO 6 --- [ main] oConfiguration$WelcomePageHandlerMapping : Adding welcome page: class path resource [templates/index.html]
2017-04-11 08:44:03.411 INFO 6 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2017-04-11 08:44:03.506 INFO 6 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2017-04-11 08:44:03.518 INFO 6 --- [ main] com.s.b.d.App : Started App in 5.108 seconds (JVM running for 5.93)