Kaven's Blog Kaven's Blog
工具软件
  • TypeScript整理
  • 构建工具

    • Webpack
    • Vite
  • 管理工具

    • Bit
服务端
DevOps
问题收录
面试秘籍
github (opens new window)

Kaven Long

当年写过的bug 可都是别人的青春
工具软件
  • TypeScript整理
  • 构建工具

    • Webpack
    • Vite
  • 管理工具

    • Bit
服务端
DevOps
问题收录
面试秘籍
github (opens new window)
  • Bit

    • Bit 私有化部署
      • 一、Bit 简介
      • 二、BVM 简介
      • 三、私有化部署
  • bit
Kaven
2022-07-24

Bit 私有化部署

# 一、Bit 简介

Bit 是一个强大的组件协作平台,它能跨项目、跨存储库地隔离并管理组件。

Bit 官网 (opens new window)

Bit Docker 使用 (opens new window)

# 二、BVM 简介

BVM 是 Bit 的版本管理器。使用 BVM 可以更轻松地在单个环境中安装和管理多个版本的 Bit。

# 三、私有化部署

# 1.安装 BVM

npm i -g @teambit/bvm
yarn global add @teambit/bvm
1
2

# 2.安装 Bit

bvm install
1

# 3.使用 Dockerfile 制作 Docker 镜像

// Dockerfile
FROM node:12.22.0
USER root

RUN npm i @teambit/bvm -g
RUN bvm upgrade
ENV PATH=$PATH:/root/bin

# increase memory to avoid 137 error code
ENV NODE_OPTIONS=--max_old_space_size=4096

RUN bit config set analytics_reporting false
RUN bit config set no_warnings false
RUN bit config set interactive false
RUN bit config set error_reporting true

ARG SCOPE_PATH=/root/remote-scope
WORKDIR ${SCOPE_PATH}
RUN bit init --bare
CMD bit start
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

# 4.构建镜像

docker build -f ./Dockerfile-bit-server --build-arg BIT_VERSION={version} -t bitcli/bit-server:{version} .
docker build -f ./Dockerfile --build-arg BIT_VERSION=latest -t bitcli/bit-server:latest .
1
2

# 5.配置环境变量

// MacOS
echo 'export PATH=$HOME/bin:$PATH' >> ~/.zshrc && source ~/.zshrc

// Linux
echo 'export PATH=$HOME/bin:$PATH' >> ~/.bashrc && source ~/.bashrc
1
2
3
4
5

# 6.启动容器

docker run -it -v {scope-path-on-host}:/root/remote-scope -p {host-port}:3000 bitcli/bit-server:latest
docker run -it -v /bit-scope:/root/remote-scope -p 8000:3000 bitcli/bit-server:latest
1
2

# 7.访问 Bit 服务

http://xxxx.xxxx.xxxx:8000/
1
最近更新
01
TypeScript编写规范
05-21
02
Vue3.0 + TypeScript + webpack项目迁移到Vite
03-22
03
TypeScript 简介
01-22
更多文章>
Theme by Vdoing | Copyright © -2022 Kaven
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式