0

I'm attempting to dockerize a python script someone at my workplace wrote, but it makes several calls to our presto database. When I call the script locally, I simply have to entire my password and it works, however running the script once it has been dockerized results in a 401 Error, invalid credentials. What do I need to do to make sure the dockerized script can access the certificate?

I checked to make sure the presto.pem file is in the directory of the dockerized script, and I know that the script is clearly accessing the presto database since it's a credential issue. I changed to a different wifi that shouldn't have access to the database and it started giving me a different error, so I know that's not the problem.

Here is my Dockerfile:

FROM python:3.7

WORKDIR /app

COPY . /app

RUN pip install -r requirements.txt

ENTRYPOINT ["python", "app.py", "--website-id=556f210de4b00a3ed267bc91"]

1 Answers1

0

It looks like a networking issue. You can review your docker setting and this problem can be resolved.

The host has a changing IP address (or none if you have no network access). 
From 18.03 onwards our recommendation is to connect to the special DNS name host.docker.internal, which resolves to the internal IP address used by the host.
The gateway is also reachable as gateway.docker.internal

Reference links:

Access host database from a docker container

https://docs.docker.com/engine/reference/commandline/run/

Ashish
  • 5,723
  • 2
  • 24
  • 25