thingsboard编译过程记录

358 阅读1分钟

基于 docker centos 环境,通过源码编译的方式打包,然后将 rpm 文件放到服务器中运行

下载 thingsboard 源码

github.com/thingsboard…

创建 centos7 容器

docker pull centos:7

编写 docker-compose.yml

services:
  centos:
    image: centos:7
    container_name: centos7
    command: /bin/bash
		restart: always
    tty: true
    volumes:
      - /your_thingsboard_path:/home/thingsboard
    environment:
      - TZ=Asia/Shanghai

启动容器

docker compose up -d

容器初始化配置

  1. 安装 vim
yum install vim
  1. 安装 wget
yum install wget
  1. 安装 java
yum install java-11-openjdk
  1. 安装 git
yum install git
  1. 安装 maven

手动下载 3.8.1 版本的 maven 包

MAVEN_HOME=/usr/local/apache-maven-3.8.1
export PATH=${MAVEN_HOME}/bin:${PATH}
  • 修改镜像仓库为阿里云
  • source /etc/profile

尝试进行编译

mvn clean install -DskipTests

编译报错

  1. release version 11 not supported
  1. gradle 下载失败
  • 手动下载 gradle 到对应目录
  • /root/.gradle/wrapper/dists/gradle-7.1.1-bin/
  1. yarn install error
  1. flot 安装失败
  • git config http.sslVerify "false"
  1. web-ui yarn run pkg error
  • 修改 web-ui package.json pkg 命令中的 x64 为 arm64
  1. 手动下载 fetched-nodejs 到 .pkg-cache 目录 github.com/vercel/pkg-…