ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.

Home Page:https://ossrs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When deploying SRS with Docker, the service for mapping external configuration files cannot be started.

keyue0459 opened this issue · comments

After pulling the ossrs/srs:3 image from Docker, you can directly run the container in the following way. The service can be started normally, even if the -d parameter is added.
docker run -p 1935:1935 -p 1985:1985 -p 8080:8080 ossrs/srs:3
However, if you map your own external configuration file, the service will not start properly, even if the external configuration file is the same as the default configuration file in the image.
docker run -p 1935:1935 -p 1985:1985 -p 8080:8080 -v /path/of/yours.conf:/usr/local/srs/conf/srs.conf ossrs/srs:3

There is no error message in the logs either. Adding -it to run the container interactively, the mapped configuration file is fine. Manually executing ./objs/srs -c conf/srs.conf can also start the service normally. It seems that the container automatically exits after executing the SRS startup command.

After being reminded by a senior in the DingTalk group, I added the following parameters to my external configuration file to disable the daemon mode:
daemon off;
After running the container again, the problem was resolved. I'm recording this for reference for other students who may encounter the same issue!

TRANS_BY_GPT3

👍 Under docker and k8s, SRS needs to make corresponding changes, such as setting the daemon to default off under docker. I will improve this in SRS4.

TRANS_BY_GPT3

Add configuration, default to on, automatically disable daemon in docker:

# Whether disable daemon for docker.
# If on, it will set daemon to off in docker, even daemon is on.
# default: on
disable_daemon_for_docker on;

TRANS_BY_GPT3