Date post: | 13-Apr-2017 |
Category: |
Technology |
Upload: | evan-lin |
View: | 131 times |
Download: | 1 times |
Introduction Docker for Hardware Company
Evan Lin
Agenda
❖ Comparison between Docker and VM
❖ Docker Architect
❖ Some examples
❖ Limitations
❖ How to use docker in our daily work
❖ Q&A
Docker Architecture
Docker
Dockerfile Docker Image
containerbuild run
download image
update
Some examples
❖ Run docker for launch server in second.
❖ Run docker for compiling modules
❖ Build docker image and run container
Example 1: Establish a LAMP in second
docker run -d -p 49001:80 dockerfiles/centos-lamp
Example 1.5: Run second LAMP in the same computer
❖ How much time do we need to launch second LAMP server in VM?
❖ How much time do we need to launch second LAMP server in Docker?
Example 1.5: Run second LAMP in the same computer
http://evan:49002http://evan:49001
49002:8049001:80
< 1 Second !
Run VM for compiling modules
PHP 5
Python2
Python3
GCC 4.8
GCC 5.2
PHP 7
Original way in VM
Run docker for compiling modules
New way in Docker
gcc 5.2gcc 4.8
resultresult
Run docker for compiling modules
New way in Docker
Ubuntu 15.01 g++ cmake
mount volume
Windows 10
Build docker image and run container
Dockfiles Image Container
Build docker image and run container (ex: Linux App)
write Dockfiles
run image as Container
build docker Image
Build docker image and run container (ex: Linux App)
run sh in Docker Container
Limitations
❖ No Windows/Mac Image and Container for now
❖ Run on Windows/Mac will launch another ubuntu VM which still limited its memory and CPU
How to use docker in our daily work
❖ Using dockerfile to store image in Gitlab for CI
❖ Ensure your computer (Host) stay in clean stage
❖ It is very easy to deliver build environment to another college/vendor by passing dockerfile.
Example: Ensure isolate host environment
gcc 5.2gcc 4.8 gcc + Android NDK Go 1.5
Ubuntu 15.01 + Only install Docker
Example: Use docker in JNI C++ Library
Original way
Ubuntu 15.01 Android NDK
Cmakeg++
Example: Use docker in JNI C++ Library
Ubuntu 15.01 + Android NDK Ubuntu 15.01 + cmake + g++
New way in Docker
Example: Use docker in JNI C++ Library (Dockerfile)
Dockerfile: Ubuntu 15.01 + cmake + g++
Q&A