Search code examples
javadockerkurento

How to run kurento java web server on docker


I want to run this kurento example: https://doc-kurento.readthedocs.io/en/stable/tutorials/java/tutorial-one2one.html

But I have some issues with application server when I building it on docker.

When I run kms docker - it run's successfully. I setted port of kurento-media-server as 8889:8888 and IP in docker container when I checked was 172.17.0.2. Also, I setted port of web app as 8081:8080.

When i tried to open a web-page - it was not responded.

My url was: https://192.168.0.2:8443, where 192.168.0.2 is IP of my server where I run docker. Also I tried to connect to docker container IP directly with https://172.17.0.3:8443.

Here's my app dockerfile.

FROM ubuntu:16.04
MAINTAINER USER1 "[email protected]"
RUN apt-get update
RUN apt-get install git -y
RUN apt-get install curl -y
RUN apt install apt-utils -y
RUN apt install maven -y
RUN apt install openjdk-8-jdk openjdk-8-jre -y
RUN apt-get install software-properties-common -y
RUN git clone https://github.com/Kurento/kurento-tutorial-java.git
WORKDIR kurento-tutorial-java/kurento-one2one-call-advanced/

EXPOSE 8080

ENTRYPOINT mvn -U clean spring-boot:run -Dkms.url=ws://172.17.0.2:8888/kurento

Here's my kms run command:

docker run -t  --name kms -p 8889:8888 kurento/kurento-media-server

Here's my app server run command:

docker run -d --name apps -p 8081:8080 --link kms apps

What mistakes I have made here? May'be I need to change IP in ENTRYPOINT?


Solution

  • I spent many weeks to find out the reason why it's not working.

    To make everything work, I needed to add --network=host line in docker command.

    Correct docker command is

    docker run --network=host -t --name apps -p 8081:8080 apps