github.com/ggreg80/ketos@v0.0.0-20171109040536-049616f51ddb/docs/workflow.md (about)

     1  Workflow
     2  ====
     3  
     4  Example:
     5  
     6  ```bash
     7  xcb pull alpine:3.6 ./alpine-3.6
     8  cd ./alpine-3.6
     9  cp ~/asset.txt ./
    10  xcb chroot sh -c 'echo hello >> /hello.txt'
    11  xcb commit
    12  xcb push --image-name setekhid/alpine:3.6
    13  ```
    14  
    15  First pull down a docker image from registry to a directory, and extract it into `.ketos` folder.
    16  
    17  Then do some stuff, like copy some assets file to the working directory. You may wanna change rootfs into it to execute some program like the 4th line.
    18  
    19  Subcommand `chroot`, will change rootfs to working directory and combine the image pulled before as the lower layer.
    20  
    21  And then commit as a new layer.
    22  
    23  Finally, push back to docker registry. Each steps you are working on are only modifying the working directory and basing the image which you pulled at first and storing at `.ketos`.
    24  
    25  
    26  ## 步骤
    27  
    28  1. parse dockerfile ,将每一条解析成一个cmd
    29  2. 使用linux的一些命令,主要是namespace,chroot 简单组装出一个容器环境,这个环境要可以运行第一步中解析出的cmd
    30  3. 将working container commit成一个镜像, 镜像应该是可以用`docker images`读取的