I'm currently working on a server written in C++ which uses cpprestsdk
. cpprestsdk
uses boost::asio
. Much of my development is done on the Mac and not in a Docker container. When it come time to deploy a new version, I build to run in a Docker container which will then be run on an EC2 instance.
I recently added in support to get config files from S3. To do this I use cpprestsdk
's http_client
. Within the code to send requests, it will do an asio
async_resolve
. This will fail with the error
Host not found (authoritative)
I have determined that if I change the base image to ubuntu:16.04
, then it will run properly. busybox
and alpine
will yield that error. I have also discovered that if I use curl
then it can download the data from the endpoint I'm using. However if I use nslookup
, it cannot find anything. For example, running nslookup
on google.com yields
nslookup: can't resolve '(null)': Name does not resolve
I have tried a few things based on what I have found online such as using numeric_service
with the constructor of the query
, using "http" as the port instead of "80" (I've done the SSL versions too). I've also tried to run the container with the host's DNS.
For example, this is one of the links I reviewed.
boost asio: "host not found (authorative)"
So far, I haven't been able to find out how to get this to work properly.
Note, as a fallback I can use ubuntu:16.04
as the base image. I would just prefer the smaller size of busybox
or alpine