https://kotlinlang.org logo
Title
j

jean

06/25/2021, 8:30 AM
I’m trying to publish my ktor app through docker by following this doc https://ktor.io/docs/docker.html#building-and-running-the-docker-image. When running
docker build -t my-app .
I’m getting this error message :
=> ERROR [3/4] COPY ./build/install/docker/ /app/                                                                                                                                             
------
 > [3/4] COPY ./build/install/docker/ /app/:
------
failed to compute cache key: "/build/install/docker" not found: not found
What am I doing wrong here?
a

Aleksei Tirman [JB]

06/25/2021, 8:32 AM
It's assumed that name of your project is
docker
. Maybe that's the problem. You can try to replace the path to
./build/install/<project-name>
j

jean

06/25/2021, 9:41 AM
yeah I tried that too, and I was running into another issue down the line. Let me try again to see what it was
docker: Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: exec: "./docker": stat ./docker: no such file or directory: unknown.
I figured it out! I also had to replace
CMD ["./my-app"]
maybe the doc should mention that devs have to replace this
docker
value by their actual project name
a

Aleksei Tirman [JB]

06/25/2021, 10:36 AM
I am glad you solved it. I've created an issue to address this problem.
j

jean

06/25/2021, 11:34 AM
thnks for the help 🙂