- 本地docker构建
docker build -t $APP_NAME:$TAG
- 本地检测是否运行正常,命令运行完后访问http://localhost:19999/查看是否发布成功
docker run -p 19999:19999(这个端口号是项目的dockerfile文件中expose出来的端口号) -d $APP_NAME:$TAG
- 登录远程镜像仓库
docker login -u $USERNAME -p $PASSWORD $DOCKER_REGISTRY
- push build好的镜像到远程仓库
docker push $DOCKER_REGISTRY/$APP_NAME:$TAG
- 将镜像地址和端口号提供给后端人员进行部署