- 打包/发布镜像
- 初始化 Dockerfile, .dockerignore, k8s.app.yml
- 友好的输出(stdout / stderr)
npm i -g node-dockerify-cli
export K8S_LOCAL_REGISTRY=[local-registry-domain]
export K8S_PRODUCTION_REGISTRY=[production-registry-domain]
export K8S_NAMESPACE=[namespace]
ndc -h
Usage: ndc <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
编译镜像
publish|p Publish a new image to registry
发布镜像
deploy|d Deploy a new stack or update an existing stack
部署镜像(目前仅支持部署到本地的k8s)
clean|c Clean Dummy
清理过期文件及镜像
init|i Geneate the Dockerfile, .dockerignore, k8s.app.yml
初始化默认文件
ndc init -m MAINTAINER -a APP_NAME -p NODE_PORT
ndc build -a APP_NAME
ndc publish -a APP_NAME -e dev
ndc publish -a APP_NAME -e prod|production
ndc deploy -a APP_NAME
ndc clean
若指定服务名称,则同时会清除相关的镜像及none
的镜像
ndc clean -a APP_NAME