<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, May 14, 2014 at 1:59 PM, Johannes Kastl <span dir="ltr"><<a href="mailto:mail@ojkastl.de" target="_blank">mail@ojkastl.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">Just one thing, you overlayed the hosts / with another directory<br>
</div>
(/opt/container/data), </blockquote><div><br></div><div>On further consideration, it might be better to set it as /var/lib/lxc/host/rootfs as the overlay mountpoint (to make it consistent with other containers) and /var/lib/lxc/host/overlay-data for to store the changes (so that it's in the same directory). Use whatever is best for you though.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">which should contain the changes compared to /.<br>

<br>
But why do you bind-mount /usr and /lib into the container? This<br>
should be included with the overlayfs, or am I missing something?<br>
<br></blockquote><div><br></div><div>That design is based on the assumptions that "most updates will replace current binaries, but you can still use old configuration/state". To be complete, I probably should've bind-mount read-only /bin and /sbin as well.</div>
<div><br></div><div>Without the bind-mount, the container would be able to write things to it's own /usr and /lib, thus breaking the link with the host. This behavior is desired for some directories (e.g. /etc, /var), where you want the container to have it's own copy. However it is NOT desired if you want updates on the host to propagate to the container.</div>
<div><br></div><div>So with the binary directories bind-mounted read-only:</div><div>- the container will have (mostly) it's own writable root fs</div><div>- updates on the CONTAINER (including new package installation) will FAIL due to read-only bind-mount. This is intended.</div>
<div><div>- updates to binary directories on the HOST will also be seen by the CONTAINER. This is intended.</div></div><div><br></div><div>-- </div><div>Fajar</div></div></div></div>