首先安装和启动docker
然后创建容器:
-
- MySQL
filename: begin_mysql_server_in_docker.sh
content
docker run -d -p 3306:3306 --name mysql_latest -e MYSQL_ROOT_PASSWORD=123456 mysql:latest
-
- PostgreSQL
filename: begin_postgres_server_in_docker.sh
content:
# After this container created, use the following command to start service:
# docker start postgres_latest
docker run -d -p 5432:5432 --name postgres_latest -e POSTGRES_PASSWORD=123456 -e POSTGRES_USER=postgres postgres:latest
启动容器分别用:
docker start mysql_latest
docker start postgres_latest
-
- ffmpeg
filename: elf_start_media_server_for_ffmpeg.sh
content:
echo "You can run the following command to start media server"
echo " sudo ~/github/ZLMediaKit/release/linux/Debug/MediaServer -d &"
echo "==============================================================="
echo "But this one hold all ports that is conflict with nginx!"
echo "Let's use docker instead:"
echo " docker run -id -p 1935:1935 -p 8080:80 -p 8443:443 -p 554:554 -p 8000:8000/udp zlmediakit/zlmediakit:master"
CMD="docker ps|grep zlm"
echo "\n--> $CMD"
sh -c "$CMD"
-
- rtsp
filename: lets_nohup_rtsp_server.sh
content:
#!/usr/bin/env python
"""启动/关闭rtsp服务"""
import os
import sysurl=repr("rtsp://0.0.0.0/live/test")
cmd="ffmpeg -re -stream_loop -1 -i ~/test.mp4 -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp "+url
stop=sys.argv[1:] and (sys.argv[1] in ("1", "stop", "kill", "killall"))
cmd="killall -9 rtsp_ffmpeg" if stop else "nohup rtsp_{} &".format(cmd)
print("--> "+cmd)
sys.exit(os.system(cmd))