In my current pipeline configuration I have to build and run several docker containers in the same step due to the lack of an image container in the system, which other pipeline tools might have. Somehow it still doesn't let me connect the containers into the same network. I run my app frontend and backend with dependencies and do a quick health check on them with curl, and they seem to be fine. When I start the third docker container which contains E2E tests, I try and connect it to the same network that the frontend is in, using
network_name=$(docker inspect frontend | jq -r '.[0].NetworkSettings.Networks | to_entries | .[0].key')
docker run --network=$network_name tests
where frontend is the name of the container where frontend runs, and tests is the name of the image that has been successfully built for tests.
How do I connect these images to the same network?