dd-trace-rb
dd-trace-rb copied to clipboard
Put all docker-compose services on an internal network.
What does this PR do?
Instead of exposing ports to the host via port:, expose them all only to the internal network and arrange for all services to be on this network.
Motivation:
This permits running docker-compose when the host machine also is running datadog-agent, mysql server, etc. The docker-compose services should now be completely isolated from the host services.
Additional Notes:
This PR should not change behavior for any operations performed inside docker. However, if any users run the docker-compose command and then access the component services from the host machine for some reason, this will no longer work.
Also, there may be cached docker state that could cause docker-compose to fail to start the environment if you already started it previously to applying this PR. I fixed this by either renaming the directory with the checked out dd-trace-rb tree (which creates a new namespace for the containers and also networks) or by rm -rfing the entire /var/lib/docker/*.
How to test the change?
- Install datadog agent or mysql server on the host machine and start them.
- Run
docker-compose run --rm tracer-3.0 /bin/bash
For Datadog employees:
- [ ] If this PR touches code that signs or publishes builds or packages, or handles
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance. - [ ] This PR doesn't touch any of that.
Unsure? Have a question? Request a review!
This PR should not change behavior for any operations performed inside docker. However, if any users run the docker-compose command and then access the component services from the host machine for some reason, this will no longer work.
I depend on this for my workflow, I'll give this PR a try and see if I can still access docker-compose services (like elastic-search) from the host somehow.
Should we make a decision on this PR? E.g. either explicitly merge it or close it?
I will close this for now since I don't actively need the proposed functionality at the moment.