【发布时间】:2018-04-18 13:32:43
【问题描述】:
我的 jhipster 后端应用程序使用 mysql 和 elasticsearch,我使用“./mvnw package -Pprod dockerfile:build -DskipTests”成功构建了一个 docker 镜像,然后我登录并将镜像推送到私有注册表,然后打开生产 Centos 7,我登录该注册表并成功提取图像。 然后我用 sudo 发出命令“Docker run iamgeid”,并出现以下异常:
2018-04-17 15:28:42.613 INFO 6 --- [ main] com.james.app.HdBackApp : The following profiles are active: prod
2018-04-17 15:28:50.061 INFO 6 --- [ main] com.james.app.config.WebConfigurer : Web application configuration, using profiles: prod
2018-04-17 15:28:50.072 INFO 6 --- [ main] com.james.app.config.WebConfigurer : Web application fully configured
2018-04-17 15:28:52.201 ERROR 6 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
在官网:https://www.jhipster.tech/docker-compose/,我注意到命令:
docker-compose -f src/main/docker/app.yml up
但是在生产中,没有这样的文件,我的问题是(就我而言): 1. 是否有一个命令供所有人运行后端,包括自动拉取依赖项,如 mysql、elasticsearch 等 2. 如果没有这个命令,具体的运行方式是什么,注意:我在构建镜像之前已经在docker文件夹下的文件(如app.yml,mysql.yml等)中设置了正确的参数。
感谢和问候!
【问题讨论】: