Upgrade to Pro — share decks privately, control downloads, hide ads and more …

从零开始,打造 Ruby 项目的容器化集成工具

Ivan Chou
September 19, 2017

从零开始,打造 Ruby 项目的容器化集成工具

Ivan Chou

September 19, 2017
Tweet

Other Decks in Programming

Transcript

  1. 快递柜01 快递柜02 快递柜03 快递柜04 快递柜05 快递柜06 快递柜6w …… Business
 Center

    (Rails) Sidekiq Queue01 Queue02 Queue03 Queue04 Queue05 Queue14 …… RubyApp01 RubyApp02 RubyApp03 RubyApp04 RubyAppX …… OtherApp 若⼲干 ⾃自建DDOS ⽆无脑 Retry
  2. Rancher an open source project that provides a complete platform

    for operating Docker in production https://github.com/rancher/rancher
  3. 因地制宜 1 Maybe you think this is the translation of

    the title, but it’s not. hahaha ~ 重新设计镜像,规划打包流程
  4. base_image ubuntu_image Ruby APP + work_image 10 mins at least

    ruby:2.3.1 base_image Gemfile + App_base_image Ruby APP + work_image about 30sec install deps & bundle Before After
  5. 100 200 300 400 500 600 700 800 900 (MB)

    Before After 镜像减肥 镜像设计的核⼼心思想:是简,不不是⼩小
  6. Base_Image 打包内容⼀一览 ▸ 本地化
 (语⾔言、时区、apt 源、gem 源) ▸ 必需的依赖
 (libmysqlclient-dev

    etc.) ▸ 被认为必要的⼯工具
 (sudo curl cron vim htop runit nscd) ▸ OpenResty ▸ live 账户初始化 ▸ pups
  7. ⼀一劳永逸 2 Maybe you think this is the translation of

    the title, but it’s not. hahaha ~ 功能模块化,建项⽬目如搭积⽊木
  8. docker run templates content of all templates pups content run

    cmd docker commit docker tag PUPS from base_image push image 这是个⿊黑箱镜像啊~ 镜像打包⼯工具 packer
  9. 化繁为简 3 Maybe you think this is the translation of

    the title, but it’s not. hahaha ~ 配置要够简单,也要够灵活
  10. runit + entrypoint.sh etc/ !"" runit/ # !"" 1.d #

    # %"" 00-commands-for-launch # %"" 3.d # %"" 01-commands-for-halt !"" service/ # !"" cron # # !"" run # # %"" supervise # !"" nginx -> /etc/service-available/nginx # !"" nscd # # !"" run # # %"" supervise # %"" puma -> /etc/service-available/puma %"" service-available/ !"" nginx # !"" run # %"" supervise %"" puma !"" run %"" supervise
  11. 授⼈人以⻥鱼 4 Maybe you think this is the translation of

    the title, but it’s not. hahaha ~ 管理理界⾯面化,降低使⽤用成本