加速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 |
监控一下是否正常走了设置的代理
当proxy出现故障时, docker-compose up 或者 pull 会报错:
1 | [+] Running 1/0 |
解决办法可以是删除上面的代理配置, 重启docker服务.
相关内容
灵感来源
假如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
docker pull 中EOF错误的解决办法(之一)
1 | root@debian12:~/synctv# docker-compose up |
可通过代理docker的流量来解决这个错误, 或者添加墙内的镜像地址:
中国的docker镜像地址
1 | local country=$(curl -s ipinfo.io/country) |
Mac系统彻底关闭或卸载Docker的命令
发现MAC下的docker后台占用了超多的内存, 要避免这种严重吃内存的尴尬局面

1 | launchctl list | grep docker |
1 | launchctl stop application.com.docker.docker.1558478.1558763 |
完整指南
osascript -e ‘quit app “Docker”
ps aux | grep -i docker | awk ‘{print $2}’ | xargs kill -9
下面是删除/卸载
sudo rm -rf /Applications/Docker.app
cd /usr/local/bin/
sudo rm -rf docker docker-compose docker-machine docker-credential-* com.docker.* hub-tool* kube* vpnkit*
rm -rf ~/Library/Application\ Support/Docker\ Desktop
rm -rf ~/Library/Group\ Containers/group.com.docker
rm -rf ~/.docker
rm -rf ~/Library/Caches/com.docker.docker
rm -rf ~/Library/Preferences/com.docker.docker.plist
rm -rf ~/Library/Logs/Docker\ Desktop