git克隆最新的ws-scrcpy代码
git clone git@github.com:NetrisTV/ws-scrcpy.git
进入ws-scrcpy目录新建Dockerfile文件,内容如下
FROM node:16-alpine
WORKDIR /appRUN npm config set registry http://mirrors.cloud.tencent.com/npm/
RUN npm install -g node-gyp
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
RUN apk add android-tools make g++COPY . .
RUN npm install
RUN npm run distEXPOSE 8000
CMD ["node","dist/index.js"]
这里node版本用16就行,较新的版本会构建失败
构建ws-scrcpy镜像
docker build -t ws-scrcpy .
启动ws-scrcpy容器
docker run -d --name scrcpy1 -p 8000:8000 ws-scrcpy
启动一个redroid容器
docker run -d --privileged -p 5555:5555 redroid/redroid:14.0.0-latest
查看docker0网卡ip,我这里是172.17.0.1
ip addr show docker0
ws-scrcpy连接redroid设备
docker exec scrcpy1 adb connect 172.17.0.1:5555
浏览器访 http://主机IP:8000,显示如下
点击Broadway.js、H264 Converter、Tiny H264中的一个即可访问
https://hub.docker.com/r/redroid/redroid
https://github.com/NetrisTV/ws-scrcpy
https://github.com/scavin/ws-scrcpy-docker
https://github.com/remote-android/redroid-doc
https://blog.imoeq.com/scrcpy-run-a-android-web-page/
https://meta.appinn.net/t/topic/33828