加速Docker Pull或者docker-compose拉取镜像 - 适用github源
为github的docker源提速
下载zlib(github上的)非常幸苦,速度极慢
找到了大神的文章:加速docker pull
有什么用
为github的docker源提速,比如:
ghcr.io/zlib-searcher/zlib-searcher:latest
ghcr.io/puzzithinker/zlib-searcher:master
怎么用
- 配置http-proxy.conf
 
1  | mkdir -p /etc/systemd/system/docker.service.d  | 
- 配置https-proxy.conf
 
1  | 
  | 
- 重启服务
 
1  | sudo systemctl daemon-reload  | 
- 监控一下是否正常走了设置的代理
 
相关内容
灵感来源
假如Docker image的源repository被删除了
1  | You will need to save the Docker image as a tar file:  | 
将docker内文件拷贝到本地文件夹内
  docker cp 容器Id或name:容器内路径 本地文件夹路径
  docker cp containername:/usr/share/nginx/html /volume2/KingchuxingSSD512G/docker/compose/it-tools/html
反之亦然
NAS中无法使用该文方案
失败错误:
1  | ERROR: error pulling image configuration: Get "https://production.cloudflare.docker.com/registry-v2/docker  | 
环境NAS中 docker pull alfg/nginx-rtmp
docker pull 如何走代理?
执行像上面那样的步骤
sudo systemctl daemon-reload
sudo systemctl restart docker
1  | sudo systemctl restart docker  | 
暂时放弃了该NAS中的docker,目前无法解决这个错误。(等待第二天自动重启后查看状态)
切换到debian中可以正常pull(已经打了这个‘补丁’)
/www/server/panel/data/compose/
或者 在docker-compose文件中 使用国内可用的镜像地址
- 比如:registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5
 
Docker 通过ffmpeg将rtsp转码为rtmp进行播放
整个流程说明:rtsp转rtmp直播.md
切换docker镜像到docker run -d -p 1935:1935 -p 8080:8080 alqutami/rtmp-hls
1  | version: "3"  | 
配置 nginx-hls.conf
1  | nginx-hls.conf  | 
是否需要做配置?
上面这个方案的docker pull成功,但是无法正常启动;切换:
1  | version: "3"  | 


推流
1  | ffmpeg -i "rtsp://a:a@192.168.6.126:554" -f flv -r 25 -an rtmp://192.168.6.116:1935/stream/test  | 
使用镜像自带的players播放
- To play RTMP content (requires Flash): 
http://localhost:8080/players/rtmp.html - To play HLS content: 
http://localhost:8080/players/hls.html - To play HLS content using hls.js library: 
http://localhost:8080/players/hls_hlsjs.html - To play DASH content: 
http://localhost:8080/players/dash.html - To play RTMP and HLS contents on the same page: 
http://localhost:8080/players/rtmp_hls.html