- [x] 打包镜像
- [x] 发布到 k8s
- [ ] 友好的输出(stdout / stderr)
- [x] 生成 Dockerfile
- [x] 生成 .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 的命名空间
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
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
tdt deploy -a APP_NAME -e prod|production
tdt clean
若指定服务名称,则同时会清除相关的镜像及none
的镜像
tdt clean -a APP_NAME