Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
c21562b
Update README.md
haoduoding Oct 25, 2018
16510d5
Update README.md
haoduoding Oct 26, 2018
8a9c1d0
Update README.md
haoduoding Oct 26, 2018
f884e77
Add files via upload
haoduoding Oct 26, 2018
88785a8
Delete 屏幕快照 2018-10-26 12.54.04.png
haoduoding Oct 26, 2018
51df14e
Create lab screenshots
haoduoding Oct 26, 2018
ba1ee93
Delete lab screenshots
haoduoding Oct 26, 2018
7df7838
add lab screenshots files
Oct 26, 2018
f50eb20
Update README.md
haoduoding Oct 26, 2018
82a8057
Update README.md
haoduoding Oct 26, 2018
eb691f6
Update README.md
haoduoding Oct 26, 2018
06d8f86
Update README.md
haoduoding Oct 26, 2018
dac5473
Update README.md
haoduoding Oct 26, 2018
f7edd26
Update README.md
haoduoding Oct 27, 2018
f6aac43
lab screenshots update
Oct 27, 2018
a9f0a9f
Update README.md
haoduoding Oct 27, 2018
f21180b
Update README.md
haoduoding Oct 28, 2018
cdabba3
Update lab screenshots/屏幕快照 2018-10-28 01.53.49.png
Oct 28, 2018
af7cd4a
Update README.md
haoduoding Oct 28, 2018
f3559cf
Update README.md
haoduoding Oct 29, 2018
3b52a86
Update README.md
haoduoding Oct 29, 2018
e8a8d70
update
Oct 29, 2018
103fe87
Update README.md
haoduoding Oct 29, 2018
8818933
Update README.md
haoduoding Oct 29, 2018
d513f84
update
Oct 29, 2018
894b428
Update README.md
haoduoding Oct 29, 2018
fee1c34
update
Oct 29, 2018
1da737f
Update README.md
haoduoding Oct 29, 2018
8ef05cf
upload
Oct 29, 2018
6c62928
Update README.md
haoduoding Oct 29, 2018
9a2d9c8
upload
Oct 29, 2018
64f6343
Update README.md
haoduoding Oct 29, 2018
fd69134
Update README.md
haoduoding Oct 29, 2018
e61f52a
Update README.md
haoduoding Oct 29, 2018
464df20
upload
Oct 29, 2018
b8bbfb2
Update README.md
haoduoding Oct 29, 2018
f72c185
upload
Oct 29, 2018
919b1e2
Update README.md
haoduoding Oct 29, 2018
b0549e9
upload
Oct 29, 2018
efb5530
Update README.md
haoduoding Oct 29, 2018
25ad238
Update README.md
haoduoding Oct 29, 2018
514157c
Update README.md
haoduoding Oct 29, 2018
a964ec3
upload
Oct 29, 2018
ee3d5dd
Update README.md
haoduoding Oct 29, 2018
1851539
Update README.md
haoduoding Oct 29, 2018
0a3e6a1
upload
Oct 29, 2018
7534f2a
Delete ops-swarm-stack-service-task.svg
haoduoding Oct 29, 2018
37952b1
Update README.md
haoduoding Oct 29, 2018
564f03c
upload
Oct 29, 2018
ef0595e
Update README.md
haoduoding Oct 29, 2018
5ae684c
Update README.md
haoduoding Oct 29, 2018
a807310
Update README.md
haoduoding Oct 30, 2018
35c358a
Update README.md
haoduoding Oct 30, 2018
a8ba161
Update README.md
haoduoding Oct 30, 2018
c5663d8
Update README.md
haoduoding Oct 30, 2018
6d146d9
upload
Oct 30, 2018
ebb77c6
Update README.md
haoduoding Oct 30, 2018
fdad08e
upload
Oct 30, 2018
e96c5ac
Update README.md
haoduoding Oct 30, 2018
575fc39
Update README.md
haoduoding Oct 30, 2018
45adac5
upload
Oct 30, 2018
e44d0d9
Update README.md
haoduoding Oct 30, 2018
67e55c6
Update README.md
haoduoding Dec 2, 2018
0cbeab5
Update README.md
haoduoding Dec 3, 2018
3627430
Update README.md
haoduoding Dec 7, 2018
4a1c442
Update README.md
haoduoding Dec 7, 2018
e458859
upload pics
Dec 7, 2018
090909e
Update README.md
haoduoding Dec 7, 2018
7c04bd1
Update README.md
haoduoding Dec 7, 2018
15a6587
Update README.md
haoduoding Dec 8, 2018
b6cab4c
upload screenshots
Dec 8, 2018
03158f3
upload screenshots
Dec 8, 2018
7cb4a55
Update README.md
haoduoding Dec 8, 2018
798dd30
Update README.md
haoduoding Dec 8, 2018
b0dd806
upload screenshot
Dec 9, 2018
56f18b9
Update README.md
haoduoding Dec 9, 2018
b932c08
upload
Dec 9, 2018
134d144
Update README.md
haoduoding Dec 9, 2018
e2e73de
final screenshots
Dec 9, 2018
3f0a5fb
Create 屏幕快照 2018-12-09 04.49.29.png
Dec 9, 2018
80031fa
Update README.md
haoduoding Dec 9, 2018
cefe3e7
Update README.md
haoduoding Dec 9, 2018
c95a739
upload Technical Report
Dec 9, 2018
b626502
tech report
Dec 10, 2018
fb46f9b
Update Technical Report.md
haoduoding Dec 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
793 changes: 789 additions & 4 deletions README.md

Large diffs are not rendered by default.

173 changes: 173 additions & 0 deletions Technical Report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# Hello Docker

<div align=center>

![Docker](https://github.com/haoduoding/dist-sys-practice/blob/master/lab%20screenshots/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202018-12-09%2018.42.57.png?raw=true)

</div>

<div align=center>

```Docker: Build, Ship, and Run Any App, Anywhere```

</div>

I heard about the name of Docker not long after it was released.
At that time, I didn't have any specific concepts about distributed systems, so I didn't go deep into Docker.
This semester I chose the course distributed system from [Prof. Tim Wood](https://faculty.cs.gwu.edu/timwood/).
I was once again exposed to Docker, a cute blue whale, during class and after class.
This Technical Report briefly summarizes some of the important concepts involved in Docker.

## What's Docker

Docker is written in GO and uses several features of the Linux kernel to provide its functionality.
Docker lets you manage CPU, memory, network and disk resources just like managing virtual machines.
Docker is an open platform for rapid development, distribution, and deployment of applications.
It provides an abstraction at the operating system level and isolates the application's dependencies on the infrastructure (operating system, etc.).
At the same time, Docker solves the consistency of production, testing, and deployment environments.

Docker provides containers (loosely coupled and isolated environments) to package and run applications.
Good security and isolation allow us to run multiple containers on a single host.
Because the container is a load that runs directly in the kernel of the host machine and does not require an additional hypervisor (such as a virtual machine that requires a VMware hypervisor),
the container is said to be lightweight (This is one of our final exam questions :) ).

## Docker Engine

<div align=center>

![Docker Engine](https://github.com/haoduoding/dist-sys-practice/blob/master/lab%20screenshots/docker%20engine.png?raw=true)

</div>

As you can see from the figure,
the client uses the docker CLI (command line tool) to interact with the docker daemon (docker daemon) through the Docker REST API.
The docker daemon is responsible for creating and managing Docker objects (such as images, containers, networks, and storage volumes).

## Docker's Application Scenario

<div align=center>

![8 Dockers Use Case](https://github.com/haoduoding/dist-sys-practice/blob/master/lab%20screenshots/docker%20application.png?raw=true)

</div>

**Deliver Applications Quickly and Consistently**

Docker streamlines the development cycle by using a container that provides applications and services to provide a standardized working environment.
Containers are very useful in continuous integration and continuous development (CI/CD).

Consider the following example scenario:

* Developers write code locally and share their work with colleagues using Docker containers.

* Developers use Docker to push applications into the test environment and perform automated and manual tests.
When developers find errors, they can fix them in the development environment and redeploy them to the test environment for testing and verification.

* Once the test is complete, pushing the fix to the customer is as simple as pushing the updated image to the production environment.

**Responsive Deployment and Scaling**

Docker's portability and lightweight features also make it easy to dynamically manage workloads, expanding and shrinking applications and services in real-time as demanded.

**Run Multiple Workloads on a same Hardware**

Docker's lightweight and fast-running features allow us to do more with fewer resources and maximize the use of computer resources.
Docker is ideal for high-density environments and small to medium-sized deployments.

## Architecture of Docker

<div align=center>

![Docker Architecture](https://github.com/haoduoding/dist-sys-practice/blob/master/lab%20screenshots/docker%20arch.png?raw=true)

</div>

As we can see from the figure, Docker is a C/S architecture.
The client interacts with the Docker daemon through the REST API, which pulls the image from the Registry (the repository, such as DockerHub), builds, runs, and distributes the container.

## Docker VS Vitual Machine

First, Docker is a container management technology, not a virtualization technology.
It is fundamentally different from the virtual machines we know:

<div align=center>

![Docker And VM](https://github.com/haoduoding/dist-sys-practice/blob/master/lab%20screenshots/VM_vs_Docker.png?raw=true)

</div>

As you can see from the above figure, Docker is based on the Docker engine to share the hardware resources of the host, using the container to provide a stand-alone operating environment to run the application.
The VM is based on the Supervisor (virtual hypervisor) using virtual machine technology to provide isolated virtual machines, providing operating environment on the virtual machine's operating system.
While both provide good resource isolation, it's clear that Docker's virtualization overhead is lower.


<div align=center>

| Characteristic | Container | VM |
| :------| :------ | :------ |
| Start up | Second level | Minute level |
| Hard disk usage | ~MB | ~GB |
| Performance | Close to native | Worse than |
| System support | Stand-alone support for thousands of containers | Tens of |

</div>

## Core terminology

Below we will focus on some of the core terms that Docker involves: Registry, Image, Container, Stack, Service, and Swarm.

**Registry**

The Docker Registry is used to store Docker images. For example, Docker's official [Docker Hub](https://hub.docker.com/) is an open repository.
Above we can find the image we want. Of course, we can also create a private mirror warehouse.

When we execute the ```Docker pull``` or ```Docker run``` command, if there is no required image locally, then an image will be downloaded from the repository (typically DockerHub).
Docker executes the run method to get a container, and the user performs various operations in the container.
Docker executes the commit method to convert a container into a mirror.
Docker pushes the local image to the repository using commands such as login and push.
This image can be used on other machines or servers to generate a container to run the corresponding application.
In addition, we can perform mirroring transactions in the [Docker Store](https://store.docker.com/).

**Image**

The image is self-reading and is used to create Docker containers.
We can commit ourselves to our own image after making some additional custom changes based on an image.
You can also use Dockerfile to build our own image. Docker uses mirror layering technology, and each instruction in the Dockerfile is created as a layer in the image.

**Container**

The container is the most important concept in docker.
Container is a running instance of mirror. It is an isolated, resource-controlled portable runtime environment, which contains the operating system, the programs that need to run, the dependencies of running programs, and the environment variables, etc.
We can create a container for the specified image through ```docker run <image>```, which will attach a read-write layer to the image when the container is created.
We can connect the container to one or more networks and attach storage to it, or create a new image based on its current state.
Docker uses namespace technology to achieve isolation between containers.
Changes to the container are temporary, and when the container is stopped, the corresponding changes are lost.
We can persist the storage by mounting the volume.

**Docker Swarm**

Docker Swarm is the name of Docker's standalone native clustering tool.
Docker Swarm clusters multiple Docker hosts and exposes them as a single virtual Docker host.

**Service**

Through the service we can do a good job of container expansion.
By default, the service is load balanced between all working nodes under Swarm.
In Docker we define, run, and extend services by writing ```docker-compose.yml```.

**Stack**
A Stack is a group of interrelated services that share dependencies and can be coordinated and scaled together.
A single Stack can define and coordinate the functionality of the entire application.

This is my first time writing a technical report in the form of a blog. I hope I can do better in the future.

## References

[Docker Offcial Documents](https://docs.docker.com/engine/docker-overview/)

[Docker glossary](https://docs.docker.com/glossary/)





Binary file added lab screenshots/.DS_Store
Binary file not shown.
Binary file added lab screenshots/VM_vs_Docker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lab screenshots/application arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lab screenshots/docker application.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lab screenshots/docker arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lab screenshots/docker engine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lab screenshots/loop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lab screenshots/overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lab screenshots/workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.