github.com/ggreg80/ketos@v0.0.0-20171109040536-049616f51ddb/docs/prez/index.html (about) 1 <html lang="en"> 2 3 <head> 4 <meta charset="utf-8"/> 5 <title>Cross Container Builder</title> 6 <link href="css/prez.css" rel="stylesheet"/> 7 </head> 8 9 <body class="impress-not-supported"> 10 11 <div class="fallback-message"> 12 <p>Your browser <b>doesn't support the features required</b> by impress.js, so you are presented with a simplified 13 version of this presentation.</p> 14 <p>For the best experience please use the latest <b>Chrome</b>, <b>Safari</b> or <b>Firefox</b> browser.</p> 15 </div> 16 17 <div id="impress"> 18 19 <div class="step" data-x="0", data-y="0"> 20 <h1>Ketos</h1> 21 <p>Cross Container Building Utilities</p> 22 <p>🎉Go Hackathon 2017 @Shanghai🎉<br /> 23 -- made by Huitse Tai & Ace Tang</p> 24 </div> 25 26 <div class="step" data-x="1000" data-y="0"> 27 <h1>What does the Ketos mean?</h1> 28 <p>In Ancient Greek, the word ketos denotes a large fish, a whale, a shark, or a sea monster.</p> 29 <p>The term cetacean (for whale) originates from cetus. In Greek art, cetea were depicted as serpentine fish. The name of the mythological figure Ceto is derived from ketos. The name of the constellation Cetus also derives from this word.</p> 30 </div> 31 32 <div class="step" data-x="2000" data-y="0"> 33 <h1>What's this?</h1> 34 <ul> 35 <li> 36 <h4>A set of utilities which aims to replace docker build in CI platform.</h4> 37 </li> 38 <li> 39 <h4>Operating with docker registry:</h4> 40 <ul> 41 <li><h5>Can pull docker image from registry</h5></li> 42 <li><h5>Can commit to generate a new image layer</h5></li> 43 <li><h5>Can push back the new image with our DIY layers to registry</h5></li> 44 </ul> 45 </li> 46 <li> 47 <h4>A few of fake chroot solution utilities to help you DIY your own image layers.</h4> 48 </li> 49 </ul> 50 </div> 51 52 <div class="step" data-x="3000" data-y="0"> 53 <h1>Why?</h1> 54 <ul> 55 <li> 56 <h4>Imaging with the world missing <code>docker build</code>, how would you DIY a docker image?!</h4> 57 <ul> 58 <li>Download a docker image as base image, actually the <code>manifest.json</code> is all you need usually.</li> 59 <li>Use tar command to tar a whole directory and gzip it, that your new layer.</li> 60 <li>Updating <code>manifest.json</code> you downloaded at step one, add your new layer to it.</li> 61 <li>Upload all your work.</li> 62 </ul> 63 </li> 64 65 <li> 66 <h4>Digging deeper what does <code>docker build</code> actually do?</h4> 67 </li> 68 </ul> 69 </div> 70 71 <div class="step" data-x="4000" data-y="0"> 72 <h1>CI Platform</h1> 73 <p>look at this trending of whole 2017 <a href="https://g.co/trends/Hncq1">https://g.co/trends/Hncq1</a></p> 74 <ul> 75 <li>I though the trending is enough to explain why our CI platform should support docker image building.</li> 76 <li>And I though the trending is enough to explain why our CI platform should use docker container to do building.</li> 77 <li><h4>So, we should build a CI platform to do <code>docker build</code>ing in docker containers.</h4></li> 78 </ul> 79 </div> 80 81 <div class="step" data-x="5000" data-y="0"> 82 <h1>Now <code>docker build</code></h1> 83 <ul> 84 <li><h4>Do you really need <code>cgroup</code>, if your building task is executing in a docker container or your own PC?!</h4></li> 85 <li><h4>Do you really need <code>namespace</code>, if your building task is executing in a docker container or your own PC?!</h4></li> 86 <li><h4>In our image-DIY page, it seems that we don't need to be privileged.</h4></li> 87 <li><h4>Considering so many problem of <code>dind</code> <a href="http://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/">here</a> (I'm not saying there are no solutions), and so many troubles.</h4></li> 88 </ul> 89 </div> 90 91 <div class="step" data-x="6000" data-y="0"> 92 <h1>So here we are, 🎉Ketos🎉</h1> 93 <ul> 94 <li><h4>It helps you building each layer of an image.</h4></li> 95 <li><h4>It helps you combining layers to an image.</h4></li> 96 <li><h4>It helps you manually managing docker registry as you like.</h4></li> 97 </ul> 98 </div> 99 100 <div class="step" data-x="7000" data-y="0"> 101 <h1>Tasting</h1> 102 <pre><code># start tasting environment 103 docker-compose up --build -d 104 docker exec -it ketos_ketos_1 105 # begin 106 mkdir -p /taste 107 cd /taste 108 xcb init --image alpine:3.6 . 109 echo "this is a static asset file" \ 110 > ./blabla_little_magical_spirit 111 chr libc --tag 3.6 -- \ 112 bach -c 'echo 巫泰到此一游 > /a-poor-tree.txt' 113 xcb commit --tag 3.6 114 xcb push</code></pre> 115 </div> 116 117 <div class="step" data-x="8000" data-y="0"> 118 <h1>The Core</h1> 119 <ul> 120 <li><h4>Integration with docker registry</h4> 121 <ul> 122 <li>thanks to the design of docker registry service, we can do more.</li> 123 </ul> 124 </li> 125 <li><h4>Imitate a fake rootfs</h4> 126 <ul> 127 <li>LD_PRELOAD to hook into libc calling</li> 128 <li>ptrace with SYS_PTRACE cap, may cause some kernel bugs, but theoretically it's safe</li> 129 <li>chroot, a long history</li> 130 <li>runc, huge and not so suitable for CI</li> 131 </ul> 132 </li> 133 </ul> 134 </div> 135 136 <div class="step" data-x="9000" data-y="0"> 137 <h1>libc hook</h1> 138 <ul> 139 <li>after digging some documents. golang's syscall design cause us a lot of trouble, but worth.</li> 140 <li>thanks to the mess of POSIX, the kernel interact is not as easy as we expected.</li> 141 <li><h4>but we made it!</h4></li> 142 </ul> 143 </div> 144 145 <div class="step" data-x="10000" data-y="0"> 146 <h1>some valuable features will be added</h1> 147 <ul> 148 <li><h4>keeping tearing down docker image push command</h4> 149 <ul> 150 <li>for: parallel building each independent layer and combine to one</li> 151 </ul> 152 </li> 153 <li><h4>supporting more chroot replacing solution</h4></li> 154 </ul> 155 </div> 156 157 <div class="step" data-x="11000" data-y="0"> 158 <h1>thanks!</h1> 159 </div> 160 161 </div> 162 163 <script src="js/impress.js"></script> 164 <script>impress().init();</script> 165 166 </body> 167 168 </html>