-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
aozhuochao
committed
Sep 10, 2024
1 parent
1b11698
commit 1d6c013
Showing
2 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: ws-scrcpy-构建和提交docker | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- "ws-scrcpy/**" | ||
- ".github/workflows/ws-scrcpy.yml" | ||
- "!**.md" | ||
|
||
jobs: | ||
|
||
# 并发构建 | ||
setup-build-publish-v3: | ||
runs-on: ubuntu-latest | ||
name: 构建和推送docker镜像v3 | ||
steps: | ||
|
||
- name: 更新代码 | ||
# 使用action库 actions/checkout获取源码 | ||
uses: actions/checkout@v3 | ||
|
||
|
||
- | ||
name: 登录 Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: adockero | ||
password: ${{ secrets.PASSWORD }} | ||
|
||
# ########## 构建 ########################### | ||
|
||
|
||
- name: 构建镜像 adockero/ws-scrcpy | ||
uses: docker/build-push-action@v3 | ||
with: | ||
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags | ||
# tags: adockero/docker:ubuntu-ssh,adockero/docker-ubuntu:ssh | ||
tags: adockero/ws-scrcpy | ||
# Path to the Dockerfile (Default is '{path}/Dockerfile') | ||
context: ./ws-scrcpy | ||
file: "./ws-scrcpy/Dockerfile" | ||
# Always attempt to pull a newer version of the image | ||
# pull: true | ||
push: true | ||
# 构建参数 | ||
# build-args: NODE_VERSION=14 | ||
# APK_ARG=rsync | ||
# Adds labels with git repository information to the built image | ||
labels: true | ||
|
||
# - name: 构建镜像 adockero/node-service:node-11-alpine | ||
# uses: docker/build-push-action@v3 | ||
# with: | ||
# # Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags | ||
# tags: adockero/node-service:node-11-alpine | ||
# # Path to the Dockerfile (Default is '{path}/Dockerfile') | ||
# context: ./node | ||
# file: "./node/Dockerfile.service" | ||
# # Always attempt to pull a newer version of the image | ||
# pull: true | ||
# push: true | ||
# # 构建参数 | ||
# build-args: | | ||
# FROM_ARG=node:11-alpine | ||
# # APK_ARG=rsync | ||
# # Adds labels with git repository information to the built image | ||
# labels: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM node:16-alpine | ||
# MAINTAINER Scavin <scavin@appinn.com> | ||
# @see https://github.com/scavin/ws-scrcpy-docker/blob/main/Dockerfile | ||
|
||
ENV LANG C.UTF-8 | ||
|
||
RUN npm install -g node-gyp \ | ||
&& apk add --no-cache build-base android-tools \ | ||
&& wget https://github.com/NetrisTV/ws-scrcpy/archive/refs/heads/master.zip \ | ||
&& unzip master.zip \ | ||
&& rm -f master.zip \ | ||
&& cd ws-scrcpy-master \ | ||
&& npm install \ | ||
&& npm run dist \ | ||
&& apk del build-base \ | ||
&& npm uninstall -g node-gyp \ | ||
&& rm -f /var/log/*.log \ | ||
&& echo '结束' | ||
|
||
WORKDIR /ws-scrcpy-master | ||
|
||
# RUN apt update;apt install android-tools-adb -y | ||
# RUN git clone https://github.com/NetrisTV/ws-scrcpy.git . | ||
# RUN npm install | ||
# RUN npm run dist | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["node","/ws-scrcpy-master/dist/index.js"] |