/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Administration/Server/Virtualization/containers/docker/terms.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2017-04-03 02:45:17 UTC
  • Revision ID: csa@suren.me-20170403024517-dwzj0z0k1cmhxm7u
Restructuring, OpenShift, Ansible, Git

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Terms
2
 
=====
3
 
 Docker is built around concept of layers which can be seen as delta updates.
4
 
 - There are multiple read-only layers forming the static image and a single
5
 
 writable layer on top of the image.
6
 
 - Image + writable layer is a Container, a running copy  of the image.
7
 
    - Actually, also plus environment and plus mounted volumes
8
 
    - The images may have a multiple associated containers (detached containers)
9
 
    - Each container can be saved to create a new image
10
 
 - The container data is persistented across runs, but can be easily reseted
11
 
 from the image. Additionally, the persistent volumes from host system can be 
12
 
 mapped into the container. 
13
 
    - This can be either existing host directory or auto-created mapping 
14
 
    associated with container.
15
 
    - Some of such mappings can be declared to hold temporary files during
16
 
    the 'docker run' state
17
 
 - Each command (event MAINTAINER) in docker file creates another layer. 
18
 
 This leads to layer poisoning and there is some limit to number of layers (127?)
19
 
    - For this reason, normally multiple RUN commands are combined
20
 
    - There are non-official squashing tools, but, then, all history is lost
21
 
        https://github.com/jwilder/docker-squash
22
 
 - Layers can be re-used by multiple containers. For this reason the proper
23
 
 composition is important. For instance:
24
 
        OpenSuSE -> mc -> adei
25
 
                       -> mysql
26
 
 - There is no defined way how to start a new image. Rather docker recomends
27
 
 to start of some exisiting docker image. 
28
 
    - OpenSuSE has Kiwi tool to build images (including docker ones) and it uses
29
 
    the tool to build official OpenSuSE docker images. However, it recommends to 
30
 
    branch of the official OpenSuSE images, rather than using the tool itself.
31
 
 
32
 
 Details:
33
 
    https://docs.docker.com/engine/userguide/storagedriver/imagesandcontainers/
34
 
 
35
 
Container Lify Cycle
36
 
--------------------
37
 
 - Create an container from the image
38
 
 - Start container 
39
 
 - Pause/Resume container
40
 
 - Stop container (auto-restart can be configured)
41
 
 - Optionally create a new image from the container
42
 
 - Delete container
43
 
 
44
 
 
45
 
Management
46
 
----------
47
 
 * Cron Jobs: Docker is designed to run a single application. There is a several ways to run cron in the container.
48
 
    - Trigger cron job from the host system using docker exec. This is in-optimal as it will break when we start using 
49
 
    orchestration and allow container migration between nodes of the cluster.
50
 
    - Run multiple services in container with 'supervisor' (python). Both cron and anacron seems required. Should
51
 
    work, but goes a bit against the base idea of docker.
52
 
    - Provide a minimal cron container which will trigger tasks in the main container with docker exec.
53
 
    
54
 
 * Monitoring
55
 
    - We can't directly see free space on the host volumes from inside the container
56
 
    
57
 
 
58
 
 
59
 
 
60