1.2.7 • Published 5 years ago

tb-docker-tools v1.2.7

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

Teambition Docker Tools

支持

  • 打包镜像
  • 发布到 k8s
  • 友好的输出(stdout / stderr)
  • 生成 Dockerfile
  • 生成 .dockerignore

安装

npm i -g git+ssh://git@code.teambition.com:tng/tb-docker-tools.git

配置环境变量

export DOCKER_LOCAL_REGISTRY=registry.teambition.corp
export DOCKER_PRODUCTION_REGISTRY=docker-registry.teambition.net
export K8S_NAMESPACE=ng # nodejs 的命名空间

CLI

tdt -h

Usage: tdt <command>

Options:

  -V, --version               output the version number
  -a, --app <app>             the application name
  -h, --help                  output usage information

Commands:

  build|b                    Build an image from a Dockerfile
  deploy|d                   Deploy a new stack or update an existing stack
  clean|c                    Clean Dummy
  init|i                     Geneate the Dockerfile, .dockerignore, k8s.app.yml
tdt build -h

Usage: build|b [options]

Build an image from a Dockerfile

Options:

  -a, --app <app>              the application name
  -n, --npm <npm source type>  yarn or pkg, default `pkg`
  -h, --help                   output usage information

生成默认的 Dockerfile & .dockerignore & k8s.app.yml

tdt init -m "sb <sb@sb.com>" -a abc-app -p 40000 -n pkg|yarn

生成镜像

tdt build -a APP_NAME -n pkg|yarn

发布到开发环境

tdt deploy -a APP_NAME -e dev

发布到生产的 registry

tdt deploy -a APP_NAME -e prod|production

清理

tdt clean

若指定服务名称,则同时会清除相关的镜像及none的镜像

tdt clean -a APP_NAME