I am trying to build a reusable docker image for NLP data projects. I have built a Dockerfile in the following way:
FROM python:3.8
COPY requirements.txt .
RUN pip install -r requirements.txt
ENV PYTHON_PACKAGES="\
numpy \
matplotlib \
scipy \
scikit-learn \
pandas \
nltk \
wordcloud \
spacy \
"
RUN pip install -r requirements.txt
RUN pip install jupyter
CMD ["jupyter", "notebook", "--allow-root"]
Note that the docker image composes correctly with all of my dependencies in the requirements file. However, when I attempt to connect on the local host, my attempt is rejected. I ran the container using the following:
docker run -dp 9999:9999 tdnlptools
I validated that the container is running:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c26b647a1403 tdnlptools "jupyter notebook --…" 7 seconds ago Up 6 seconds 0.0.0.0:9999->9999/tcp modest_mcnulty
Yet, when I attempt to use the following connection, it won't work:
https://localhost:9999/
The error is:
This site can’t be reached
localhost unexpectedly closed the connection.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_CLOSED
Any idea why my connection is being refused?
source https://stackoverflow.com/questions/72664099/cannot-connect-to-docker-image-with-localhost-port-mapping
Comments
Post a Comment