3. What is virtualization ?
Virtualization, in computing, refers to
the act of creating a virtual (rather
than actual) version of something,
including but not limited to a virtual
computer hardware platform,
operating system (OS), storage device,
or computer network resources.
– wikipedia
8. Benefits
Lower infrastructure, energy, and facility costs.
High service level and availability
Greater utilization of infrastructure investments
Enhance IT security
Fast and flexible scalability
Less administration overhead
Rapid deployment.
10. Docker is
Docker is an open platform designed for developers
and sysadmins. It's built to help you build applications
and services and then deploy them quickly and
efficiently: from development to production.
13. Architect overview
client-server application
Client and Server can run on the same system or
separately (local or distributed)
Communicate via socket or RESTful API
14. Inside Docker
Docker uses the concept of a Standard Container
which contains a software component along with all its
dependencies - binaries, libraries, configuration files,
scripts, virtualenvs, jars, etc. – and can be run on any
x64-bit Linux kernel that supports cgroups.
Don't afraid, this part won't be so long. I'll do a simple
explanation. If you want to know more, read the wiki. ;)
15. namespace
when you run a container, a set of namespace are
bundled to the container. namespace provides a layer
of isolation: each process runs in its own namespace
and does not have access outside it.
16. cgroup
Also called control groups. it allow Docker to set up
resource sharing limit.
17. union fs
UnionFS or union filesystems are filesystems that
operate by creating layers, making them very
lightweight and fast. Docker uses union filesystems to
provide the building blocks for containers.
18. container
Docker combines these components to build a
container format we call libcontainer. Docker also
supports traditional Linux containers like LXC which
also make use of these components.
19. Terminology
Docker daemon
Docker client
Container
Your application run inside the containers
Image
Your containers are built from images.
repository
A repository is a group of images located in the
docker registry
registry
Servers that store docker repositories for easier
sharing.
21. Real world example
When you join in a new project(leap frog?), you need:
install && configure suitable IDE, tools
resolve library dependencies
setup build environment
22. Don't panic
Docker will do them for you, just create a docker
image, and deploy every where.
Let's see more.
27. create image from Dockerfile
Assume that I have just finish leap frog new feature.
And below is my working directory:
$ ls
. ..
LFFramework
Libs
Thirdparty
Configs
Resource
MyAwesomeGame
Now Create a Dockfile
$ emacs -nw Dockerfile
#target os
From ubuntu:14.04
#update source
Run apt-get update
#install deps
Run apt-get install box2d bullet mali-dev scons ...
COPY . /src
RUN cd /src Scons Awesome-Game
#port sharing
EXPOSE 8888
CMD ["/src/out/Awesome-Game", "-test", "map1"]
#Then build image from this Dockerfile.
$docker build -t lf01/awesomegame-alpha .
28. Deploy, sharing
Use docker save or docker export to get image file
$ docker save lf-01/awesomegame-beta | scp to dist server
On the dist server, the can use docker load or docker
import to import the image.
$ docker import awesomegame-beta-09-9-14.tar
$ docker run lf-01/awesomegame-beta /src/out/Awesome-Game -test map1
P.S. You can launch a docker register server to store,
share docker images, but this slide don't cover this
topic. If you are interesting about it, feel free to discuss
with me.