title: which port number to choose for docker container
body: <p>I'm new to docker and when I make a container with port number 8501 it works fine, but I need to have multiple containers and when I use a new port number like 8502 it doesn't work. here is how I make and use the container which was explaied <a href="https://neptune.ai/blog/how-to-serve-machine-learning-models-with-tensorflow-serving-and-docker" rel="nofollow noreferrer">here</a>. I call the function make_prediction. this works correcty:</p>
  <pre><code>docker run -p 8501:8501 --name tfserving_classifier --mount type=bind,source=C:/Users/untitled6/voice_classifier/,target=/models/voice_classifier -e MODEL_NAME=voice_classifier -t tensorflow/serving
  </code></pre>
  <pre><code>def make_prediction(instances,url):
     data = json.dumps({&quot;signature_name&quot;: &quot;serving_default&quot;, &quot;instances&quot;: instances.tolist()})
     headers = {&quot;content-type&quot;: &quot;application/json&quot;}
     json_response = requests.post(url, data=data, headers=headers)
     predictions = json.loads(json_response.text)['predictions']
     return predictions
  
  url = 'http://localhost:8501/v1/models/voice_classifier:predict'
  predictions = make_prediction(x_test,url)
  </code></pre>
  <p>But when I change the port number to make a new container an error is shown:</p>
  <pre><code>docker run -p 8502:8502 --name tfserving_classifier1 --mount type=bind,source=C:/Users/untitled6/voice_classifier1/,target=/models/voice_classifier1 -e MODEL_NAME=voice_classifier1 -t tensorflow/serving
  
  </code></pre>
  <pre><code>def make_prediction(instances,url):
     data = json.dumps({&quot;signature_name&quot;: &quot;serving_default&quot;, &quot;instances&quot;: instances.tolist()})
     headers = {&quot;content-type&quot;: &quot;application/json&quot;}
     json_response = requests.post(url, data=data, headers=headers)
     predictions = json.loads(json_response.text)['predictions']
     return predictions
  
  url = 'http://localhost:8502/v1/models/voice_classifier1:predict'
  predictions = make_prediction(x_test,url)
  </code></pre>
  <p>The error:
  requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))</p>
  <p>So how can I have multiple containers? I need them because I need to use about 10 different models in my application.</p>