An open API service indexing awesome lists of open source software.

https://github.com/haixeefrontend/hbuilderx-docker

DCloud HBuilderX (Linux) in Docker for CI use
https://github.com/haixeefrontend/hbuilderx-docker

docker-image hbuilderx uniapp uniapp-cli

Last synced: 2 months ago
JSON representation

DCloud HBuilderX (Linux) in Docker for CI use

Awesome Lists containing this project

README

          


HBuilderX Linux Docker Image


[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/haixeefrontend/hbuilderx-docker/ci.yml?style=flat-square&label=CI)](https://github.com/haixeefrontend/hbuilderx-docker/actions/workflows/ci.yml)
[![GitHub Release](https://img.shields.io/github/v/release/haixeefrontend/hbuilderx-docker?style=flat-square)](https://github.com/haixeefrontend/hbuilderx-docker/releases/latest)

这个仓库包含了用于构建 [HBuilderX](https://hx.dcloud.net.cn/) 的 [Linux](https://hx.dcloud.net.cn/Tutorial/install/linux-cli) 版本 Docker 镜像的配置文件和脚本。

此外这个仓库包含了 GitHub Actions 工作流配置文件,用于在云端构建 Docker 镜像并发布到 GitHub Release。

## 使用说明

使用以下命令构建 Docker 镜像:

```bash
docker build . -t hbuilderx:latest
```

构建 slim 版本的镜像,这个版本仅保留基础的编译到 app 包所需的工具:

```bash
docker build --build-arg SLIM=true . -t hbuilderx:slim
```

构建完成后,可以使用 docker run 命令运行容器,并将项目目录挂载到容器中:

```bash
docker run --rm -it \
-v /path/to/your/project:/project \
-w /project \
hbuilderx:latest
```

当容器输出 `✅ HBuilderX started.`,表明 HBuilderX 在后台启动。
此时可以运行 HBuilderX 编译命令,如导出 app 发布资源(需要登录)

```bash
cli user login --username "" --password ""
cli project open --path "$(pwd)"
cli publish --platform APP --type appResource --project project
```

更多命令请参考 [HBuilderX CLI 文档](https://hx.dcloud.net.cn/cli/README)。

## License

本项目采用 AGPL-3.0 许可证,详情请参阅 [LICENSE](./LICENSE) 文件。