i'm new of docker's world. I'm trying to import two Dockers model downloaded from peltarion on Ubuntu version 20.04. I download docker, setup the two images and create the first container with command
docker run -p 8000:8000 model-export
when i call xxx.xx.xx.xx:8000 with http request i receive answer by it. My problem is that when i create the second container
docker run -p 8090:8090 model-export
I get the following configuration on the port
At this point i try to call with xxx.xx.xx.xx:8090, but no response.
How can i configure the container so i can call it with http request? Thanks in advance to anyone who helps me
CodePudding user response:
TLDR: your parameter values should be -p 8090:8000
.
The order of -p
/--publish
parameter values should be:
published_port:container_exposed_port
published_port
is a port used by host (your machine), where Docker is installed. And that can be used outside like a public-available service. For example it can be visible by other computers in your local network, or by Internet.container_exposed_port
is a port that is exposed from Docker container to Docker host by image (for example byEXPOSE 8000
instruction in imageDockerfile
). It's visible only for your Docker host, or for other Docker containers (Docker networking) too.