Solution skill
Connect to Milvus standalone server (in docker container) from another docker container on the same host
Complete solution
Shows how to fix connect to Milvus standalone server (in docker container) from another docker container on the same host. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
The fix looked like this: FROM python:3.9.12 ENV httpsproxy [proxy settings] COPY requirements.txt / RUN pip3 install --proxy [proxy settings] -r requirements.txt COPY task.py / ENV httpsproxy "" CMD ["python3", "-u", "task.py"] Context: When I run Milvus in standalone mode on docker (by executing docker-compose on the default Milvus docker-compose.yml file, resulting in the three containers being created), I cannot connect to the Milvus server from a task running in another docker container on the same host.
Steps
- Turns out this is not a Milvus issue. The problem was caused by our corporate network, and the proxy requirement. In the dockerfile, I need to set the proxy settings to be able to pull images. However, this sets the proxy settings during builld and for the container. These proxy settings prevented communication between the containers. The proxy setting needs to be reset in the dockerfile. The fix looked like this: FROM python:3.9.12 ENV httpsproxy [proxy settings] COPY requirements.txt / RUN pip3 install --proxy [proxy settings] -r requirements.txt COPY task.py / ENV httpsproxy "" CMD ["python3", "-u", "task.py"]
When to use
You are seeing this: Turns out this is not a Milvus issue. Use this skill when you run into "Connect to Milvus standalone server (in docker container) from another docker container on the same host".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: python 3.9.12. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: When I run Milvus in standalone mode on docker (by executing docker-compose on the default Milvus docker-compose.yml file, resulting in the three containers being created), I cannot connect to the Milvus server from a task running in another docker container on the same host. I have configured this container to be on the same network as the Milvus server, and I can ping the Milvus server from this container via the Milvus server's IP. In the task container I run: connections.
Verified resolution: Turns out this is not a Milvus issue. The problem was caused by our corporate network, and the proxy requirement. In the dockerfile, I need to set the proxy settings to be able to pull images. However, this sets the proxy settings during builld and for the container. These proxy settings prevented communication between the containers. The proxy setting needs to be reset in the dockerfile. The fix looked like this: FROM python:3.9.12 ENV httpsproxy [proxy settings] COPY requirements.txt / RUN pip3 install --proxy [proxy settings] -r requirements.txt COPY task.py / ENV httpsproxy "" CMD ["python3", "-u", "task.py"]
Source URL: https://stackoverflow.com/questions/74520985/connect-to-milvus-standalone-server-in-docker-container-from-another-docker-co
By @issueatlas · Version 3 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_4FF6I9DLWDHAYQ13sh0BVQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Connect to Milvus standalone server (in docker container) from another docker container on the same host <span>— Vectle</span></a>