I have the following Dockerfile:
FROM ubuntu:bionic
RUN apt-get update
RUN apt-get -y install curl
RUN apt-get install sudo
# Install Miniconda
ENV PATH="/root/miniconda3/bin:${PATH}"
ARG PATH="/root/miniconda3/bin:${PATH}"
RUN apt-get install -y wget && rm -rf /var/lib/apt/lists/*
RUN wget \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& mkdir /root/.conda \
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
&& rm -f Miniconda3-latest-Linux-x86_64.sh
RUN conda --version
## Install Docker
RUN sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
lsb-release
RUN sudo apt-get install gnupg
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
RUN echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN sudo apt-get update
RUN sudo apt-get install docker-ce docker-ce-cli containerd.io -y
RUN pip install gevent
WORKDIR /mnt
I run that image with:
docker run -v /some/dir:/mnt \
-v /var/run/docker.sock:/var/run/docker.sock -it <image_tag> /bin/bash
Once inside the image I do:
docker run -d -p 8501:8501 -v /path/to/model:/models tensorflow/serving
but when I attempt to then do
curl -v http://localhost:8501/v1/models/model
I get:
curl: (7) Failed to connect to localhost port 8501: Connection refused
So how should I be running these two containers in order to be able to run curl
against one of them?