docker-test

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Docker Test

Docker测试

Test voxtype builds and packages in isolated Docker containers.
在隔离的Docker容器中测试voxtype的构建产物与软件包。

Build Testing

构建测试

Build AVX2 Binary (Clean Toolchain)

构建AVX2二进制文件(纯净工具链)

Uses Ubuntu 22.04 to avoid AVX-512 instruction contamination:
bash
./scripts/build-docker.sh
Output:
releases/${VERSION}/voxtype-${VERSION}-linux-x86_64-avx2
使用Ubuntu 22.04以避免AVX-512指令污染:
bash
./scripts/build-docker.sh
输出:
releases/${VERSION}/voxtype-${VERSION}-linux-x86_64-avx2

Build Vulkan Binary

构建Vulkan二进制文件

Uses remote Docker context (pre-AVX-512 CPU) for clean build:
bash
./scripts/build-docker-vulkan.sh
Output:
releases/${VERSION}/voxtype-${VERSION}-linux-x86_64-vulkan
使用远程Docker上下文(无AVX-512的CPU)进行纯净构建:
bash
./scripts/build-docker-vulkan.sh
输出:
releases/${VERSION}/voxtype-${VERSION}-linux-x86_64-vulkan

Full Docker Compose Build

完整Docker Compose构建

bash
VERSION=0.4.14 docker compose -f docker-compose.build.yml build --no-cache avx2 vulkan
VERSION=0.4.14 docker compose -f docker-compose.build.yml up avx2 vulkan
bash
VERSION=0.4.14 docker compose -f docker-compose.build.yml build --no-cache avx2 vulkan
VERSION=0.4.14 docker compose -f docker-compose.build.yml up avx2 vulkan

Package Testing

软件包测试

Test Debian Package

测试Debian软件包

bash
undefined
bash
undefined

Build test container

构建测试容器

docker run -it --rm -v $(pwd)/releases:/releases ubuntu:22.04 bash
docker run -it --rm -v $(pwd)/releases:/releases ubuntu:22.04 bash

Inside container:

在容器内执行:

apt update && apt install -y /releases/0.4.14/voxtype_0.4.14-1_amd64.deb voxtype --version voxtype --help
undefined
apt update && apt install -y /releases/0.4.14/voxtype_0.4.14-1_amd64.deb voxtype --version voxtype --help
undefined

Test RPM Package

测试RPM软件包

bash
undefined
bash
undefined

Fedora

Fedora系统

docker run -it --rm -v $(pwd)/releases:/releases fedora:latest bash
docker run -it --rm -v $(pwd)/releases:/releases fedora:latest bash

Inside container:

在容器内执行:

dnf install -y /releases/0.4.14/voxtype-0.4.14-1.x86_64.rpm voxtype --version
undefined
dnf install -y /releases/0.4.14/voxtype-0.4.14-1.x86_64.rpm voxtype --version
undefined

Distro-Specific Testing

特定发行版测试

Ubuntu/Debian

Ubuntu/Debian

bash
docker run -it --rm ubuntu:22.04 bash -c "
  apt update &&
  apt install -y curl libasound2 &&
  curl -L https://github.com/peteonrails/voxtype/releases/download/v0.4.14/voxtype-0.4.14-linux-x86_64-avx2 -o /usr/bin/voxtype &&
  chmod +x /usr/bin/voxtype &&
  voxtype --version
"
bash
docker run -it --rm ubuntu:22.04 bash -c "
  apt update &&
  apt install -y curl libasound2 &&
  curl -L https://github.com/peteonrails/voxtype/releases/download/v0.4.14/voxtype-0.4.14-linux-x86_64-avx2 -o /usr/bin/voxtype &&
  chmod +x /usr/bin/voxtype &&
  voxtype --version
"

Fedora

Fedora

bash
docker run -it --rm fedora:latest bash -c "
  dnf install -y alsa-lib curl &&
  curl -L https://github.com/peteonrails/voxtype/releases/download/v0.4.14/voxtype-0.4.14-linux-x86_64-avx2 -o /usr/bin/voxtype &&
  chmod +x /usr/bin/voxtype &&
  voxtype --version
"
bash
docker run -it --rm fedora:latest bash -c "
  dnf install -y alsa-lib curl &&
  curl -L https://github.com/peteonrails/voxtype/releases/download/v0.4.14/voxtype-0.4.14-linux-x86_64-avx2 -o /usr/bin/voxtype &&
  chmod +x /usr/bin/voxtype &&
  voxtype --version
"

Arch Linux

Arch Linux

bash
docker run -it --rm archlinux:latest bash -c "
  pacman -Sy --noconfirm base-devel git &&
  # Test AUR package build
  git clone https://aur.archlinux.org/voxtype-bin.git &&
  cd voxtype-bin &&
  makepkg -si --noconfirm
"
bash
docker run -it --rm archlinux:latest bash -c "
  pacman -Sy --noconfirm base-devel git &&
  # 测试AUR软件包构建
  git clone https://aur.archlinux.org/voxtype-bin.git &&
  cd voxtype-bin &&
  makepkg -si --noconfirm
"

Docker Context Management

Docker上下文管理

For builds requiring a pre-AVX-512 CPU:
bash
undefined
对于需要无AVX-512 CPU的构建任务:
bash
undefined

List contexts

列出上下文

docker context ls
docker context ls

Switch to remote build server

切换到远程构建服务器

docker context use truenas
docker context use truenas

Build clean binaries

构建纯净二进制文件

docker compose -f docker-compose.build.yml up avx2 vulkan
docker compose -f docker-compose.build.yml up avx2 vulkan

Switch back to local

切换回本地上下文

docker context use default
undefined
docker context use default
undefined

Troubleshooting

故障排除

Build cache issues:
bash
docker compose -f docker-compose.build.yml build --no-cache
Container won't start: Check if audio devices are needed - voxtype requires ALSA/PipeWire which may not be available in containers.
Version mismatch after build: Docker cached old layers. Always use
--no-cache
for release builds.
构建缓存问题:
bash
docker compose -f docker-compose.build.yml build --no-cache
容器无法启动: 检查是否需要音频设备——voxtype依赖ALSA/PipeWire,而这些在容器中可能不可用。
构建后版本不匹配: Docker缓存了旧的镜像层。发布构建时务必使用
--no-cache
参数。