首页 > 解决方案 > JHIPSTER:Docker 不再连接到 SQL 数据库

问题描述

我已经构建了一个 docker 文件以上传到我的 AWS 环境,不再连接到我的 RDS 数据库。我已经硬编码 ECS 任务以使用以前的 docker 文件并且工作正常,所以不是网络/数据库问题我已经一一还原所有提交但仍然失败,我 98% 确定两个 docker 中的源代码是相同的。

将 docker 与 docker 桌面上的“Inspect”进行比较,我只看到一个区别,即 docker 内部使用的 java 版本:

工作版本

5   /bin/sh -c set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in aarch64|arm64) ESUM='xx'; BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jre_aarch64_linux_hotspot_11.0.10_9.tar.gz';
6   /bin/sh -c #(nop) ENV JAVA_VERSION=jdk-11.0.10+9    0 Bytes

非工作版本

5   /bin/sh -c set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in aarch64|arm64) ESUM='xx'; BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.11%2B9/OpenJDK11U-jre_aarch64_linux_hotspot_11.0.11_9.tar.gz';
6   /bin/sh -c #(nop) ENV JAVA_VERSION=jdk-11.0.11+9    0 Bytes

部分日志是:

com.mysql.cj.jdbc.exceptions.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.
..
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
浏览器和操作系统

窗户 10

docker --version Docker 版本 20.10.5,构建 55c4c88

我不确定用于构建最后一个 docker 的 docker 版本。

升级到 Docker 版本 20.10.6,构建 370c289 不能解决问题

JHipster 版本

7.0.1

谁控制用于构建 docker 的 JAVA_VERSION=jdk-11.0.xx?我怎样才能硬核它 JAVA_VERSION=jdk-11.0.10+9 只是为了确认它解决了我的问题?

- 更新 -

我看到在 pom.xml 的 jib-maven-plugin 上设置了采用openjdk。

硬编码“采用openjdk:11.0.10_9-jre-hotspot”的价值解决了我的问题,但我需要更好的解决方案的反馈。

标签: javadockerjhipster

解决方案


推荐阅读