1

I have 4 containers running in the same Docker network

  • mongodb
  • our api server
  • a selenium server
  • our tests themselves

I get this error from our test container:

 WebDriverError: File not found: /root/cdt-tests/csv-data/IT-DE-Jasper.csv

However, from my test logs, this file totally exists...in the test container.

The problem, I think, is that the selenium server is not looking at the same filesystem as our test container, because they are running in different containers.

What is the best way to solve this problem?

a. Should I try to run them in the same container?

b. Can I somehow get them to share the same filesystem?

c. ?

Community
  • 1
  • 1
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
  • 3
    Possible duplicate of [In Docker, how can I share files between containers and then save them to an image?](https://stackoverflow.com/questions/27421322/in-docker-how-can-i-share-files-between-containers-and-then-save-them-to-an-ima) – Alex Blex May 23 '17 at 23:29
  • Yes, but are we entirely sure that this is a solution to the problem? I am not 100% certain that the problem is that selenium server cannot find the file because the selenium server is running on a different filesystem...I am like 80% certain, but if someone could back that up, that would help. – Alexander Mills May 24 '17 at 18:28
  • 1
    I'd try even if I was 30% certain. It won't hurt if it doesn't work. In such case just update the question with what you have tried. – Alex Blex May 25 '17 at 08:00

2 Answers2

1

Just because you are sharing the network doesn't mean you are sharing the volumes, see how to do that In Docker, how can I share files between containers and then save them to an image? as @alex-blex suggested

Leo Gallucci
  • 16,355
  • 12
  • 77
  • 110
0

You may be able to connect the containers using a user-defined network, as explained on Docker's site

If you've already done that, it might be an issue with the path to the file you're using in your test. Perhaps it wants an absolute path, because the containers are considered different entities on the Docker network

mantisb
  • 9
  • 1