-
-
Save mattbennett/b0340fedd8a8f1fecd47cba26c7bec6b to your computer and use it in GitHub Desktop.
dnspython docker dns issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "2" | |
services: | |
test-service: | |
container_name: test-service | |
image: busybox | |
command: ['/bin/sh', '-c', 'sleep 5'] | |
test-client-eventlet: | |
container_name: test-client-eventlet | |
build: | |
context: . | |
dockerfile: Dockerfile.eventlet | |
dns_search: foo.example.com | |
test-client-unpatched: | |
container_name: test-client-unpatched | |
build: | |
context: . | |
dockerfile: Dockerfile.unpatched | |
dns_search: foo.example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.4 | |
RUN pip install eventlet | |
COPY test.py /var/tmp/test.py | |
CMD [ "python", "/var/tmp/test.py" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.4 | |
COPY test.py /var/tmp/test.py | |
CMD [ "python", "/var/tmp/test.py" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
monkeypatched = False | |
try: | |
import eventlet | |
eventlet.monkey_patch() | |
monkeypatched = True | |
except ImportError: | |
monkeypatched = False | |
import socket | |
service_url = 'test-service' | |
print('### monkeypatched? {} ###'.format(monkeypatched)) | |
ip_list = [] | |
ais = socket.getaddrinfo(service_url, 0, 0, 0, 0) | |
for result in ais: | |
ip_list.append(result[-1][0]) | |
ip_list = list(set(ip_list)) | |
print(ip_list[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected output:
Actual output: