9. What is Docker
Was first published in 2013
An open source project
Not a new technology
Run software packages called "containers"
9
10. What is Docker
1979 chroot
2000 FreeBSD Jails
2000 Linux VServer
2004 Solaris Containers
2005 OpenVZ
2006 Process Containers
2008 LXC
2013 Docker
10
20. What is Docker
Docker image
built up from a series of layers.
Each layer represents an
instruction
20
21. Docker uses containers to execute applications.
Each layer except the very last one is read-only.
Build image by Dockerfile
What is Docker
21
22. What is Docker
particularity Virtual machine Container
Lunch time Mins Secs
Storage capacity Gb Mb
Performance Virtualized Native like
Amount 10~20 1000up
22
25. Docker Repository
Docker registry could be hosted by a third party, as
public or private registry, like one of the following
registries:
Docker Hub
Quay
Google Container Registry
AWS Container Registry
Or you can host the docker registry by yourself!
25
28. Make A DockerFile
DockerFile can build images automatically
A text document that contains all the commands
DockerFiles use a simple domain-specific language(DSL)
If you hate him...there are other ways!!!
28
29. Make A DockerFile
Now let's look at an example.
We Will talk about it.
official wordpress repository:
https://hub.docker.com/_/wordpress/
29
30. Make A DockerFile
the FROM command, which tells us what image to
based this off.
In this example, it’s using the php:5.6-apache Docker
image.
If you are interested, you can also study his basic
image.
30
31. Make A DockerFile
the RUN command, which tells us what runs within
the container at build time.
In this example, it’s using many run command to
build image.
In other words, he added a lot of layers.
31
32. Make A DockerFile
the VOLUME command, which tells us what
requested a volume during the build time.
Associate the local machine with the container..
We can check it with the docker CLI.
32
33. Make A DockerFile
the ENV command, which tells us what sets the
environment variables at build time.
In this example, it sets many environment variables
to present this image.
This is like we are setting the environment variables
in the linux system
33
34. Make A DockerFile
the COPY command, which tells us what copy a file
to the container at build time.(in the same directory
as the Dockerfile)
In this example, this image copy the shell script to the
container.
You can do this for things like custom configuration
file.
34
35. Make A DockerFile
the ENTRYPOINT command, which tells us what
runs within the container at the container runtime.
If the command isn’t specified, Docker will use /bin/
sh -c as the default
This command also allows arguments to be set from
the docker run command as well.
35
36. Make A DockerFile
the CMD command, which tells us what default
argument passed to the ENTRYPOINT at the
container runtime.
In this example, it sets to apache2-foregroundwhich
therefore starts WordPress.
If you’re after more information,CenturyLink Labs
have a great blog article.
36