備註:文章編寫時間201904-201905期間,後續官方在github的更新沒有被寫入git
~
~
打包[Packaging]github
[How do I package ProxySQL for all the platforms it supports?]sql
最簡單的方法是轉到repo的根文件夾並運行「make packages」。此命令假定您已安裝Docker。除了爲全部操做系統(centos/debian/ubuntu/fedora/debug build等)建立全套軟件包外,還能夠爲特定操做系統和版本建立單獨的軟件包-如下平臺是能夠make的:
centos6.7 centos7 centos6.7-dbg centos7-dbg centos5 centos5-dbg ubuntu12 ubuntu14 debian7 debian8 ubuntu14-dbg debian7-dbg debian8-dbg
ubuntu16 ubuntu16-dbg fedora24 fedora24-dbg debian9 debian9-dbg ubuntu16-clickhouse debian9-clickhouse centos7-clickhouse fedora24-clickhousedocker
例如,您能夠經過運行 make centos7 爲CentOS 7.0建立一個軟件包,對於要集成ClickHouse,則將運行的 make centos7-clickhouse ;若是以 DEBUG 方式構建,則執行 make centos7-dbg 命令。ubuntu
[Frequent errors]
若是從打包腳本中收到這樣的錯誤:
"FATA[0000] Error response from daemon: Conflict. The name "ubuntu14_build" is already in use by container d4c8dface7bc.
You have to delete (or rename) that container to be able to reuse that name."
那麼你所要作的就是運行docker rm ubuntu14_build(或者它所給出的等效容器名稱)並從新運行打包腳本。centos
[How long does the packaging take?]
每次運行最多須要20分鐘,具體取決於主機的硬件規格和互聯網速度。緣由是它從源代碼中提取新包,並針對這些版本的包從新編譯ProxySQL。經過使用Docker層緩存機制,這個時間能夠減小到大約一半。如今咱們徹底繞過它,以確保咱們始終將ProxySQL的最新源代碼樹構建到一個包中。緩存
[Which operating system can I run the packaging on?]
從理論上講,它應該適用於任何基於debian的操做系統。咱們一般在Ubuntu上進行測試,可是它應該適用於其餘版本的Linux,由於它基於Docker。最重要的是Docker可以
在另外一個操做系統之上爲支持的操做系統運行容器。若是這被證實是不可行的,那麼從長遠來看,咱們將從Docker容器轉移到真正的VM。ide
~
~
完畢!測試