BUILD, SHIP, RUN

———— 苏依.
Insta360容器化之路

Docker 简介

Docker is an open platform for developing, shipping, and running applications. 

Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production.
Docker Engine is a client-server application with these major components:

- A server which is a type of long-running program called a daemon process.

- A REST API which specifies interfaces that programs can use to talk to the daemon and instruct it what to do.

- A command line interface (CLI) client.

Docker应用

 

  • 开发
  • 测试
  • 部署

示例:开发者中心

  • node.js
  • mysql
  • vue.js
  • php
  • mysql
  • vue.js

酱紫?

和复杂的开发环境说no!

phpmyadmin & mysql 好了?

$ cd workspace_docker/database/mysql
$ docker-compose up

 

  • 简化配置
  • 提高开发效率
  • 代码流水线(Code Pipeline
  • 应用隔离
  • 快速部署
  • ...
  • 镜像交付
  • 自主测试
  • 快速部署
  • 版本控制
  • 快速扩容

Docker 使用规范

目录结构

➔ tree -L 2
.
├── Dockerfile              打包配置
├── README.md               说明文件
├── root                    系统配置
│   └── etc
└── src                     项目代码
    ├── backend
    ├── frontend
    ├── node_modules
    └── package.json

版本&发布

分支:

- master
- dev

标签&发版:

- release-v{version}.{month}.{day}.{order}
- release-v4.11.16.03

版本&发布

测试&部署

  1. 开发自测,通过后提交dev分支
  2. 自动构建be.api.nano:dev
  3. 开发与测试沟通版本变动以及测试要点
  4. 测试登录测试平台拉去测试版镜像
  5. 测试通过,通知开发&产品去人,反之回到步骤1
  6. 开发打tag并构建
  7. 管理员部署&上线

流程演示

cr & rancher

Thanks.

Insta360内部Docker分享

By Thonatos.Yang

Insta360内部Docker分享

Insta360内部Docker分享

  • 1,317