Skip to content

Commit 5c94a9d

Browse files
author
Fun
committed
first
0 parents  commit 5c94a9d

5 files changed

Lines changed: 113 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Docker Build and Publish
2+
3+
on:
4+
push:
5+
branches: [ "main", "master" ]
6+
tags: [ 'v*.*.*' ]
7+
pull_request:
8+
branches: [ "main", "master" ]
9+
10+
env:
11+
REGISTRY: docker.io
12+
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/qqbox
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Log into Docker Hub
26+
if: github.event_name != 'pull_request'
27+
uses: docker/login-action@v3
28+
with:
29+
username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.DOCKERHUB_TOKEN }}
31+
32+
- name: Extract Docker metadata
33+
id: meta
34+
uses: docker/metadata-action@v5
35+
with:
36+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
37+
tags: |
38+
type=ref,event=branch
39+
type=ref,event=pr
40+
type=semver,pattern={{version}}
41+
type=semver,pattern={{major}}.{{minor}}
42+
type=sha
43+
44+
- name: Build and push Docker image
45+
uses: docker/build-push-action@v5
46+
with:
47+
context: ./Docker
48+
file: ./Docker/Dockerfile
49+
push: ${{ github.event_name != 'pull_request' }}
50+
tags: ${{ steps.meta.outputs.tags }}
51+
labels: ${{ steps.meta.outputs.labels }}

.wslgconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[system-distro-env]
2+
WESTON_RDP_HI_DPI_SCALING=true
3+
WESTON_RDP_FRACTIONAL_HI_DPI_SCALING_ROUNDUP=true

Docker/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM debian:12-slim
2+
3+
RUN sed -i 's/deb.debian.org/mirrors.cloud.tencent.com/g' /etc/apt/sources.list.d/debian.sources \
4+
&& apt -y update && apt -y install wget libasound2 libglib2.0-bin dbus-x11 && cd ~ \
5+
&& wget -O qq.deb https://dldir1v6.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.18_250616_amd64_01.deb \
6+
&& apt install -y ./qq.deb \
7+
&& apt-get autoclean && apt-get clean \
8+
&& rm -rf /root/.config/QQ/* && rm -rf /tmp/* \
9+
&& echo "Xcursor.size: 12" > ~/.Xresources
10+
11+
ENV ELECTRON_OZONE_PLATFORM_HINT=wayland
12+
ENV LD_LIBRARY_PATH=/usr/lib/wsl/lib
13+
VOLUME ["/root/.config/QQ"]
14+
15+
CMD ["dbus-run-session", "--", "sh", "-c", "\
16+
xrdb -load $HOME/.Xresources 2>/dev/null; \
17+
gsettings set org.gnome.desktop.interface cursor-size 12 2>/dev/null; \
18+
exec /opt/QQ/qq --no-sandbox --disable-gpu --disable-software-rasterizer --enable-unsafe-swiftshader\
19+
"]

QQ.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
wsl docker run -tid --rm --name qqbox --shm-size="1g" -e DISPLAY=$DISPLAY -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY -e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR -v /tmp/.X11-unix:/tmp/.X11-unix -v /mnt/wslg:/mnt/wslg -v /usr/lib/wsl/lib:/usr/lib/wsl/lib -v /mnt/c/Windows/Fonts:/usr/share/fonts/win11 -v /mnt/d/QQ:/root/.config/QQ -v /mnt/d/QQfiles:/root/QQfiles qqbox:latest

readme.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# QQ Docker (Linux QQ for WSL2)
2+
3+
> **Note:** 本项目仅在 Windows 11 的 WSL2 (Debian) 上测试,其他平台请自行修改和适配。
4+
5+
6+
## 项目特色
7+
8+
- 保护文件隐私
9+
- 解决高分辨率缩放模糊问题
10+
- 解决缩放后鼠标大小异常问题
11+
12+
## 启动命令
13+
14+
```bash
15+
# 在 WSL2 中启动 QQ 容器
16+
wsl docker run -tid \
17+
--rm \ # 容器停止时自动删除
18+
--name qqbox \ # 容器名称
19+
--shm-size="1g" \ # 设置共享内存大小,避免卡顿
20+
-e DISPLAY=$DISPLAY \ # 转发 X11 显示
21+
-e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \ # 转发 Wayland 显示
22+
-e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \ # 转发用户运行时目录
23+
-v /tmp/.X11-unix:/tmp/.X11-unix \ # 挂载 X11 套接字
24+
-v /mnt/wslg:/mnt/wslg \ # 挂载 WSLg 目录(支持音频、图形等)
25+
-v /usr/lib/wsl/lib:/usr/lib/wsl/lib \ # 挂载 WSL 库
26+
-v /mnt/c/Windows/Fonts:/usr/share/fonts/win11 \ # 挂载 Windows 字体
27+
-v /mnt/d/QQ:/root/.config/QQ \ # 挂载 QQ 目录到D:\QQ
28+
-v /mnt/d/QQfiles:/root/QQfiles \ # 挂载 QQ 文件目录到D:\QQfiles
29+
qqbox:latest
30+
```
31+
32+
33+
## 高分屏适配
34+
35+
如果在高分辨率环境中需要缩放,请将 `.wslgconfig` 文件放到 `%USERPROFILE%` 下,例如:
36+
37+
```
38+
C:\Users\<你的用户名>\.wslgconfig
39+
```

0 commit comments

Comments
 (0)