G
G
gingerose2021-02-05 19:11:40
Java
gingerose, 2021-02-05 19:11:40

Docker not finding text file, what could be the problem?

Good afternoon, I ran into such a problem when writing a consumer/producer using kafka. The producer uses the file to pass information to the consumer. When I run the jar file locally, everything works fine (I enter the path to the file from the command line arguments). But when I run it in the docker, for some reason it gives an error:
Failed to send message by the producerjava.nio.file.NoSuchFileException: /home/gingerose/programs/test.txt
When I work locally, I specify the same path and the file is perfectly readable.
What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2021-02-05
@gingerose

Obviously there is no such file in the container. Try to put it there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question