diff options
author | IskandarMa <epiciskandar@gmail.com> | 2022-01-19 02:24:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 18:24:02 +0000 |
commit | f6a7f4d4aca4a1808850e2dcd8cc223ae5202062 (patch) | |
tree | fefc9beff20ea6438e9c1927d83319ed4c85a6b0 /docs/zh-cn/getting_started_docker.md | |
parent | 8a3dfe2246c4a6182cf18349e9c4d0d28cae4ec5 (diff) | |
download | qmk_firmware-f6a7f4d4aca4a1808850e2dcd8cc223ae5202062.tar.gz qmk_firmware-f6a7f4d4aca4a1808850e2dcd8cc223ae5202062.zip |
update the Chinese translation based on the latest English version (#14924)
Co-authored-by: peepeetee <43021794+peepeetee@users.noreply.github.com>
Co-authored-by: Joy Lee <chang.li@westberrytech.com>
Co-authored-by: LitoMore <LitoMore@users.noreply.github.com>
Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>
Diffstat (limited to 'docs/zh-cn/getting_started_docker.md')
-rw-r--r-- | docs/zh-cn/getting_started_docker.md | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/docs/zh-cn/getting_started_docker.md b/docs/zh-cn/getting_started_docker.md new file mode 100644 index 000000000..038f17f9a --- /dev/null +++ b/docs/zh-cn/getting_started_docker.md | |||
@@ -0,0 +1,59 @@ | |||
1 | # Docker快速上手指引 | ||
2 | |||
3 | <!--- | ||
4 | original document: 0.15.12:docs/getting_started_docker.md | ||
5 | git diff 0.15.12 HEAD -- docs/getting_started_docker.md | cat | ||
6 | --> | ||
7 | |||
8 | 本工程包含了一套Docker工作流,可以方便地在不更改你主系统环境情况下完成新固件文件的构建工作。这同时也保证了在你拉取该工程代码后的编译环境与其他人以及QMK开发者的一致。当你需要其他人协助你排查遇到的问题时会方便很多。 | ||
9 | |||
10 | ## 需求 | ||
11 | |||
12 | 核心需求是一个已安装的可用的 `docker` 或 `podman`。 | ||
13 | * [Docker CE](https://docs.docker.com/install/#supported-platforms) | ||
14 | * [Podman](https://podman.io/getting-started/installation) | ||
15 | |||
16 | ## 用法 | ||
17 | |||
18 | 拉取QMK仓库到本地(包括所有的子模块): | ||
19 | |||
20 | ```bash | ||
21 | git clone --recurse-submodules https://github.com/qmk/qmk_firmware.git | ||
22 | cd qmk_firmware | ||
23 | ``` | ||
24 | |||
25 | 执行以下命令构建键映射: | ||
26 | ```bash | ||
27 | util/docker_build.sh <keyboard>:<keymap> | ||
28 | # 例: util/docker_build.sh planck/rev6:default | ||
29 | ``` | ||
30 | |||
31 | 如上可以构建所需的键盘/键映射,可用于刷写的 `.hex` 及 `.bin` 输出文件存放在QMK目录下。如果省略了 `:keymap` 参数,所有的键映射都会被编译。留意编译参数格式与 `make` 构建时的一致。 | ||
32 | |||
33 | 同时也支持直接从Docker中编译和刷写,只需要指定 `target`: | ||
34 | |||
35 | ```bash | ||
36 | util/docker_build.sh keyboard:keymap:target | ||
37 | # 例: util/docker_build.sh planck/rev6:default:flash | ||
38 | ``` | ||
39 | |||
40 | 可以不带参数地执行该脚本,其会依次要求你输入这些参数,也许你会觉得这样更好用: | ||
41 | |||
42 | ```bash | ||
43 | util/docker_build.sh | ||
44 | # 从输入中读取参数 (留空则构建所有的键盘/键映射) | ||
45 | ``` | ||
46 | |||
47 | 可以通过设置环境变量 `RUNTIME` 为想使用的容器运行时的名称或路径来指定运行时,默认其会检测并自动选取docker或podman,相比于podman会更倾向于用docker。 | ||
48 | |||
49 | ```bash | ||
50 | RUNTIME="podman" util/docker_build.sh keyboard:keymap:target | ||
51 | ``` | ||
52 | |||
53 | ## FAQ | ||
54 | |||
55 | ### 为什么我无法在我的Windows/macOS下刷写固件 | ||
56 | |||
57 | 在Windows及macOS上,需要有[Docker Machine](http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos/)运行着,配置过程很繁琐,因此我们没有做推荐。请考虑使用[QMK工具箱](https://github.com/qmk/qmk_toolbox)。 | ||
58 | |||
59 | !> Windows下需要启用[Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v)才能运行Docker,这也意味着它无法运行在没有Hyper-V的Windows版本下,如Windows 7,Windows 8及**Windows 10家庭版**。 | ||