1
resposta

[Bug] erro ao iniciar o projeto target api-cursos: failed to solve: lstat /target: no such file or directory

baixei o projeto e corri o docker compose up
recebi o erro

#9 [api-cursos 2/5] COPY target/*.jar /usr/src/myapp/api-cursos.jar
#9 ERROR: lstat /target: no such file or directory

#5 [proxy-api-cursos internal] load metadata for docker.io/library/nginx:1.18
#5 DONE 6.9s

#10 [proxy-api-cursos internal] load .dockerignore
#10 CANCELED

[api-cursos 2/5] COPY target/*.jar /usr/src/myapp/api-cursos.jar:


Dockerfile:6


4 | ARG OLTP=opentelemetry/opentelemetry-javaagent.jar

5 |

6 | >>> COPY ${JAR_FILE} /usr/src/myapp/api-cursos.jar

7 | COPY ${OLTP} /usr/src/myapp/opentelemetry-javaagent.jar

8 |


target api-cursos: failed to solve: lstat /target: no such file or directory

1 resposta

e ao tentar o mvn clean package da:
{
"timestamp" : "2025-07-31 21:07:30.293",
"level" : "ERROR",
"thread" : "main",
"logger" : "com.zaxxer.hikari.pool.HikariPool",
"message" : "HikariPool-1 - Exception during pool initialization.",
"context" : "prod",
"exception" : "org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.\n\tat org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:319)\n\tat org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)\n\tat org.postgresql.jdbc.PgConnection.(PgConnection.java:223)\n\tat org.postgresql.Driver.makeConnection(Driver.java:402)\n\tat org.postgresql.Driver.connect(Driver.java:261)\n\tat com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)\n\tat com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)\n\tat com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)\n\tat com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476)\n\tat com.zaxxer.hikari.pool.H