Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

2.4K
Views
Conexión a localhost: 5432 rechazada. Verifique que el nombre de host y el puerto sean correctos y que el administrador de correo acepte conexiones TCP/IP

Aquí mi 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"]

Mi jar es una aplicación de arranque de primavera que requiere postgres. Instalé portgres localmente y se está ejecutando correctamente en mi localhost. Estoy construyendo DockerFile con éxito por comando

 sudo docker build -t djtijare/a2i-web:v1 .

Pero mientras lo ejecuta por comando

 sudo docker run -p 8080:8080 -t djtijare/a2i-web:v1

dando excepción como:

 Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

Estoy ejecutando este comando docker desde el directorio que contiene DockerFile y mi jar. ¿Necesito establecer alguna configuración para ejecutar postgres?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

No puede acceder al servicio que en el host usa localhost desde el contenedor, tuvo que usar la dirección IP de su host para acceder.

Esto porque: la ventana acoplable predeterminada usará un puente que configurará una red interna para su contenedor, por lo que cuando el contenedor usa localhost, no significa el host, significa la red del contenedor.

Si insiste, una solución fea es usar --net=host .

Algo como lo siguiente:

 sudo docker run --net=host -p 8080:8080 -t djtijare/a2i-web:v1

Luego puede usar localhost para visitar el servicio del host desde el contenedor.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!