SlideShare a Scribd company logo
Develop With Docker
Linking Error
by qrtt1
HELP !!!
Develop With Docker
關於標題
Develop With Docker
最近在忙什麼
• 搞雲端、寫 Java、寫 Python、不想,但又得寫 C
• ⾃自⼰己的 CDN ⾃自⼰己建
• ⾃自⼰己的雲端播放器⾃自⼰己做
Develop With Docker
今天要講什麼
• ⾃自⼰己的雲端播放器⾃自⼰己建之⼀一⼩小部分
http://bit.ly/1ByJSVZ
Develop With Docker
編譯是個苦工
Internet of Things
Cross Compilation
潮
苦
Develop With Docker
• 同事A:裝不起來啊~~
• 同事B:怎麼弄的!?
• 同事C:剛剛還可以的啊!!!
• 同事X:幫我弄⼀一下
• 同事Z:Linux … 不熟哩~
準備開發環境
悲
苦
Develop With Docker
還有編譯腳本
• 年年向⿊黑道宣戰的男⼈人
• 這是 qrtt1 第 N 次向 AutoTools 宣戰
• 別說 AutoTools 了,連 Makefile 都寫得不忍直視
• 如何避免能⼒力有限形成的 Copy & Paste 世界奇觀:
• Makefile.vendor[a-zA-z0-9]+
Develop With Docker
助人為快樂之本
• [打算] 在 VM 環境好開發環境打包給同事使⽤用
• [vendor A] 要⽤用 fedora 8 裝他們的 toolchain
• [vendor B] 要⽤用 ubuntu 裝他們的 toolchain
• [vendor N] 要⽤用 xxxxxx 裝他們的 toolchain
• 天殺的到底需要做幾個開發環境!?
Develop With Docker
提案
• 建個 VM 環境,把所有東⻄西都安裝去上,再 export
發給需要開發的同事
• VM 開發環境的缺點
• 檔案較佔空間
• 執⾏行需要的資源較多
• 部分更新較不⽅方便
Develop With Docker
各式格樣的組合
開發環境 For Vendor [a-zA-z0-9]+
編譯腳本 for Vendor [a-zA-z0-9]+
X
Develop With Docker
問題摘要
• 如何免除開發環境建置、維護的負擔
• toolchain 更新
• 相依 library 更新
• 如何維護各種 toolchain 的 Makefile
Develop With Docker
• 傳統的 Servers 管理
• 使⽤用⼯工⼈人智慧,⼀一⼀一建⽴立需要的 Server
• 每次需耗損較多的⼯工⼈人時間,品質依⼯工⼈人⼼心情⽽而定
• 雲端⾵風格的 Servers 管理
• 使⽤用宣告式腳本,描述應該建⽴立的 Server
• 使⽤用⼯工具依腳本建⽴立,品質相對穩定
向雲端借鏡
Develop With Docker
Infrastructure as Code
• 基礎建設即為程式碼,例如雲端服務 AWS
CloudFormation; DevOps ⼯工具: Ansible, Chef,
Puppet
• 程式碼
• ⽅方便透過版本控制系統管理
• 狀態容易 reproduce
• 最終成果可拋式(Disposable)
Develop With Docker
• Vagrant: https://www.vagrantup.com/
• Provision ⼯工具:依腳本建⽴立出需要的 VM 環境
或 Docker Container
• Docker: https://www.docker.com/
• Linux Container 管理⼯工具:依腳本建出需要的
Docker Image
開發環境 as Code
Develop With Docker
Docker
• Docker 官網 

https://www.docker.com/

https://www.docker.com/tryit/ Docker 練習環境
• The Docker Ecosystem: An Introduction to Common
Components

http://bit.ly/1BE2WIc
• Docker 101 - Intro to Docker 

http://slidesha.re/1LxLOpD
• 深⼊入浅出Docker(⼀一):Docker核⼼心技术预览

http://bit.ly/1LxLRBN
Develop With Docker
Docker vs VM
http://bit.ly/1A6ETAd
輕
盈
Develop With Docker
• build a image from the Dockerfile
• run a container from the image
• show the history of a image
• commit changes of a container to a new image
• stop, start, rm a container; rmi a image
Docker Command
Develop With Docker
Dockerfile
• Image 建⽴立腳本
FROM ubuntu:14.04.1
RUN apt-get update -y
RUN apt-get install -y cmake
RUN apt-get install -y vim
RUN apt-get install -y wget tree
ADD scripts/bashrc /.bashrc
WORKDIR /data
Develop With Docker
Any Question Before Demonstration 

Docker Basic Commands
Develop With Docker
[文件]製作開發環境
• 設想⼀一下⼀一般的⽂文件會看到什麼...
• 啟動 docker for vendor A
• 把 vendor A 的 toolchain.tgz 解到 /opt/vendorA/
• 開始編譯 XXX Library ⾄至 /opt/vendorA/XXX
• 開始編譯 YYY Library ⾄至 /opt/vendorA/YYY
• 把它 tar 起來,上傳⾄至 s3 後續使⽤用
WTF
Develop With Docker
開發環境
我只想要⼀一個 

build-image.sh
Develop With Docker
Any Question Before Demonstration 

Build Images For VENDORs
Develop With Docker
開發環境
• 安裝 toolchain 與相關開發⼯工具
• 編譯相依 Libraries
• prefix: /opt/vendor
• 將上述需求整理成 script 與 Dockerfile
• docker build -t acme/vendor .
• 接著我們能這麼使⽤用
• docker run -ti acme/vendor /bin/bash …
Develop With Docker
專案輔助腳本
• 進⼊入 docker container
• docker-run.sh vendor
• docker run -ti acme/vendor /bin/bash
• 編譯專案
• docker-build.sh vendor
• docker run -ti acme/vendor /bin/bash build.sh
Develop With Docker
CMake
• Don’t Be Autofools
• 模組化設計,需要 OOO 功能就引⽤用 OOO 模組
• 學習撰寫、改寫 find_package
• 開發中的 library 常在⾮非系統預設路徑,適度的改
寫與客製化是必要的。http://bit.ly/1DmrtO3
• 範例:FindLibAO.cmake http://bit.ly/1DmtDgB
Develop With Docker
• CMake 2.6.0 後開始⽀支援 Cross compiling

http://bit.ly/1DmsBRN
• 將需要 Cross Compiling 設定的變數定義出來,並能
將設定獨⽴立在專屬的檔案內
Cross Compiling
cmake 
-DCMAKE_TOOLCHAIN_FILE=toolchain_vendor.cmake .
One vendor, One toolchain file
Develop With Docker
Any Question Before Demonstration 

Build our Project
Develop With Docker
組合的力量
Docker Image For Vendor [a-zA-z0-9]+
CMake Toolchain File for Vendor [a-zA-z0-9]+
X
Develop With Docker
• 如何免除開發環境建置、維護的負擔
• 如何優雅地寫出符合各種 toolchain 的 Makefile
複習一下
用 Docker,一人努力,多人享受
CMake + Find_Package + ToolchainFile
Develop With Docker
Q & A

More Related Content

PPTX
cec-hello-docker
PDF
Docker home ted
PPTX
QNAP MOPCON 2015 - 輕鬆打造持續整合開發環境,使用 QNAP Docker
PDF
docker intro
PDF
容器式基礎架構介紹
PPTX
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
PPTX
20170905 dev ops in hiiir
PDF
Wot2013云计算架构师峰会 -陈轶飞2
cec-hello-docker
Docker home ted
QNAP MOPCON 2015 - 輕鬆打造持續整合開發環境,使用 QNAP Docker
docker intro
容器式基礎架構介紹
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
20170905 dev ops in hiiir
Wot2013云计算架构师峰会 -陈轶飞2

What's hot (20)

PDF
從軟體開發角度
談 Docker 的應用
PPTX
Docker基礎
PDF
容器式軟體開發介紹
PPTX
Docker 淺入淺出
PDF
COSCUP 2016 Workshop: 用 Docker 架設班級 git-it 練習環境
PPTX
開發人員不可不知的 Windows Container 容器技術預覽
PPTX
用 Drone 打造 輕量級容器持續交付平台
PDF
Docker 最佳实践
PDF
讓軟體開發與應用更自由 - 使用 Docker 技術
PDF
20150604 docker 新手入門
PDF
認識那條鯨魚 Docker 初探
PPTX
Docker Compose
PPTX
Docker tutorial
PPTX
認識 Docker
PDF
Docker初识
PDF
Docker Build
PPTX
Docker workshop
PDF
AWS EC2 for beginner
PPTX
Rancher: 建立你的牧場艦隊
PPTX
用 Docker 改善團隊合作模式
從軟體開發角度
談 Docker 的應用
Docker基礎
容器式軟體開發介紹
Docker 淺入淺出
COSCUP 2016 Workshop: 用 Docker 架設班級 git-it 練習環境
開發人員不可不知的 Windows Container 容器技術預覽
用 Drone 打造 輕量級容器持續交付平台
Docker 最佳实践
讓軟體開發與應用更自由 - 使用 Docker 技術
20150604 docker 新手入門
認識那條鯨魚 Docker 初探
Docker Compose
Docker tutorial
認識 Docker
Docker初识
Docker Build
Docker workshop
AWS EC2 for beginner
Rancher: 建立你的牧場艦隊
用 Docker 改善團隊合作模式
Ad

Similar to Linking error (12)

PPTX
Docker 基礎介紹與實戰
PPTX
Docker 101
PDF
Docker
PPTX
Introduction to Docker
PDF
Docker容器微服務 x WorkShop
PPTX
Docker - 30秒生出100台伺服器
PDF
PDF
Docker In-Depth
PPTX
Docker
PDF
Weic2015 docker
PDF
桃園市教育局Docker技術入門與實作
PPTX
Docker進階探討
Docker 基礎介紹與實戰
Docker 101
Docker
Introduction to Docker
Docker容器微服務 x WorkShop
Docker - 30秒生出100台伺服器
Docker In-Depth
Docker
Weic2015 docker
桃園市教育局Docker技術入門與實作
Docker進階探討
Ad

More from Ching Yi Chan (12)

PDF
JCConf2016 Jenkins Pipeline
PDF
JCConf2015: groovy to gradle
PDF
老舊web上雲端
PDF
Java Build Tool course in 2011
PDF
using Queue Server for batch processing
PDF
idea: talk about the Active Cache
KEY
Talk about fabric
KEY
Java web programming
ODP
Android NDK (JUG@TW 2011, Oct.)
ODP
Unit Testing
PPT
OSGi Small Lab
PPT
Osgi Intro
JCConf2016 Jenkins Pipeline
JCConf2015: groovy to gradle
老舊web上雲端
Java Build Tool course in 2011
using Queue Server for batch processing
idea: talk about the Active Cache
Talk about fabric
Java web programming
Android NDK (JUG@TW 2011, Oct.)
Unit Testing
OSGi Small Lab
Osgi Intro

Linking error

  • 1. Develop With Docker Linking Error by qrtt1 HELP !!!
  • 3. Develop With Docker 最近在忙什麼 • 搞雲端、寫 Java、寫 Python、不想,但又得寫 C • ⾃自⼰己的 CDN ⾃自⼰己建 • ⾃自⼰己的雲端播放器⾃自⼰己做
  • 4. Develop With Docker 今天要講什麼 • ⾃自⼰己的雲端播放器⾃自⼰己建之⼀一⼩小部分 http://bit.ly/1ByJSVZ
  • 5. Develop With Docker 編譯是個苦工 Internet of Things Cross Compilation 潮 苦
  • 6. Develop With Docker • 同事A:裝不起來啊~~ • 同事B:怎麼弄的!? • 同事C:剛剛還可以的啊!!! • 同事X:幫我弄⼀一下 • 同事Z:Linux … 不熟哩~ 準備開發環境 悲 苦
  • 7. Develop With Docker 還有編譯腳本 • 年年向⿊黑道宣戰的男⼈人 • 這是 qrtt1 第 N 次向 AutoTools 宣戰 • 別說 AutoTools 了,連 Makefile 都寫得不忍直視 • 如何避免能⼒力有限形成的 Copy & Paste 世界奇觀: • Makefile.vendor[a-zA-z0-9]+
  • 8. Develop With Docker 助人為快樂之本 • [打算] 在 VM 環境好開發環境打包給同事使⽤用 • [vendor A] 要⽤用 fedora 8 裝他們的 toolchain • [vendor B] 要⽤用 ubuntu 裝他們的 toolchain • [vendor N] 要⽤用 xxxxxx 裝他們的 toolchain • 天殺的到底需要做幾個開發環境!?
  • 9. Develop With Docker 提案 • 建個 VM 環境,把所有東⻄西都安裝去上,再 export 發給需要開發的同事 • VM 開發環境的缺點 • 檔案較佔空間 • 執⾏行需要的資源較多 • 部分更新較不⽅方便
  • 10. Develop With Docker 各式格樣的組合 開發環境 For Vendor [a-zA-z0-9]+ 編譯腳本 for Vendor [a-zA-z0-9]+ X
  • 11. Develop With Docker 問題摘要 • 如何免除開發環境建置、維護的負擔 • toolchain 更新 • 相依 library 更新 • 如何維護各種 toolchain 的 Makefile
  • 12. Develop With Docker • 傳統的 Servers 管理 • 使⽤用⼯工⼈人智慧,⼀一⼀一建⽴立需要的 Server • 每次需耗損較多的⼯工⼈人時間,品質依⼯工⼈人⼼心情⽽而定 • 雲端⾵風格的 Servers 管理 • 使⽤用宣告式腳本,描述應該建⽴立的 Server • 使⽤用⼯工具依腳本建⽴立,品質相對穩定 向雲端借鏡
  • 13. Develop With Docker Infrastructure as Code • 基礎建設即為程式碼,例如雲端服務 AWS CloudFormation; DevOps ⼯工具: Ansible, Chef, Puppet • 程式碼 • ⽅方便透過版本控制系統管理 • 狀態容易 reproduce • 最終成果可拋式(Disposable)
  • 14. Develop With Docker • Vagrant: https://www.vagrantup.com/ • Provision ⼯工具:依腳本建⽴立出需要的 VM 環境 或 Docker Container • Docker: https://www.docker.com/ • Linux Container 管理⼯工具:依腳本建出需要的 Docker Image 開發環境 as Code
  • 15. Develop With Docker Docker • Docker 官網 
 https://www.docker.com/
 https://www.docker.com/tryit/ Docker 練習環境 • The Docker Ecosystem: An Introduction to Common Components
 http://bit.ly/1BE2WIc • Docker 101 - Intro to Docker 
 http://slidesha.re/1LxLOpD • 深⼊入浅出Docker(⼀一):Docker核⼼心技术预览
 http://bit.ly/1LxLRBN
  • 16. Develop With Docker Docker vs VM http://bit.ly/1A6ETAd 輕 盈
  • 17. Develop With Docker • build a image from the Dockerfile • run a container from the image • show the history of a image • commit changes of a container to a new image • stop, start, rm a container; rmi a image Docker Command
  • 18. Develop With Docker Dockerfile • Image 建⽴立腳本 FROM ubuntu:14.04.1 RUN apt-get update -y RUN apt-get install -y cmake RUN apt-get install -y vim RUN apt-get install -y wget tree ADD scripts/bashrc /.bashrc WORKDIR /data
  • 19. Develop With Docker Any Question Before Demonstration 
 Docker Basic Commands
  • 20. Develop With Docker [文件]製作開發環境 • 設想⼀一下⼀一般的⽂文件會看到什麼... • 啟動 docker for vendor A • 把 vendor A 的 toolchain.tgz 解到 /opt/vendorA/ • 開始編譯 XXX Library ⾄至 /opt/vendorA/XXX • 開始編譯 YYY Library ⾄至 /opt/vendorA/YYY • 把它 tar 起來,上傳⾄至 s3 後續使⽤用 WTF
  • 22. Develop With Docker Any Question Before Demonstration 
 Build Images For VENDORs
  • 23. Develop With Docker 開發環境 • 安裝 toolchain 與相關開發⼯工具 • 編譯相依 Libraries • prefix: /opt/vendor • 將上述需求整理成 script 與 Dockerfile • docker build -t acme/vendor . • 接著我們能這麼使⽤用 • docker run -ti acme/vendor /bin/bash …
  • 24. Develop With Docker 專案輔助腳本 • 進⼊入 docker container • docker-run.sh vendor • docker run -ti acme/vendor /bin/bash • 編譯專案 • docker-build.sh vendor • docker run -ti acme/vendor /bin/bash build.sh
  • 25. Develop With Docker CMake • Don’t Be Autofools • 模組化設計,需要 OOO 功能就引⽤用 OOO 模組 • 學習撰寫、改寫 find_package • 開發中的 library 常在⾮非系統預設路徑,適度的改 寫與客製化是必要的。http://bit.ly/1DmrtO3 • 範例:FindLibAO.cmake http://bit.ly/1DmtDgB
  • 26. Develop With Docker • CMake 2.6.0 後開始⽀支援 Cross compiling
 http://bit.ly/1DmsBRN • 將需要 Cross Compiling 設定的變數定義出來,並能 將設定獨⽴立在專屬的檔案內 Cross Compiling cmake -DCMAKE_TOOLCHAIN_FILE=toolchain_vendor.cmake . One vendor, One toolchain file
  • 27. Develop With Docker Any Question Before Demonstration 
 Build our Project
  • 28. Develop With Docker 組合的力量 Docker Image For Vendor [a-zA-z0-9]+ CMake Toolchain File for Vendor [a-zA-z0-9]+ X
  • 29. Develop With Docker • 如何免除開發環境建置、維護的負擔 • 如何優雅地寫出符合各種 toolchain 的 Makefile 複習一下 用 Docker,一人努力,多人享受 CMake + Find_Package + ToolchainFile