【发布时间】:2019-05-30 07:53:53
【问题描述】:
这里是我的 DockerFile:-
FROM openjdk:10
ENV AQUILA_HOME /data/config
#USER root
#VOLUME /tmp
ADD a2i-web-1.0.0-SNAPSHOT.jar app.jar
#RUN bash -c 'touch /app.jar'
ENTRYPOINT ["java","-jar","app.jar"]
我的 jar 是需要 postgres 的 spring boot 应用程序。 我在本地安装了 portgres,它在我的本地主机上成功运行。 我正在通过命令成功构建 DockerFile
sudo docker build -t djtijare/a2i-web:v1 .
但是在通过命令运行时
sudo docker run -p 8080:8080 -t djtijare/a2i-web:v1
给出例外:
Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
我正在从包含 DockerFile 和我的 jar 的目录中运行这个 docker 命令 我是否需要设置任何配置才能运行 postgres?
【问题讨论】:
-
您的应用想要访问 postgres?它在哪里?
-
我在本地安装了 postgres,我正在使用上面的 docker 命令构建和运行 spring boot 应用程序
标签: docker dockerfile