[prev in list] [next in list] [prev in thread] [next in thread]
List: gentoo-user
Subject: [gentoo-user] Docker mounting strangeness.
From: Laurence Perkins <lperkins () openeye ! net>
Date: 2022-12-01 19:48:30
Message-ID: MW2PR07MB4058881FF41F3BE4D9DE0964D2149 () MW2PR07MB4058 ! namprd07 ! prod ! outlook ! com
[Download RAW message or body]
[Attachment #2 (text/plain)]
Starting here in case it's something specific to Gentoo since I can't find anybody \
complaining about the behaviour elsewhere on the web.
I'm setting up an image to use Docker, which will be deployed on multiple machines. \
Since the containers will be large, I didn't want them on the root partition.
Ok, easy enough, I just put it in fstab to mount a different partition on \
/var/lib/docker. Presto, now I don't have to worry about a container using up all \
the OS's disk space.
That's where it gets weird.
Deploy the image, boot it up, everything is mounted correctly. But the first time \
(and ONLY the first time) I start Docker it somehow remounts the OS partition onto \
/var/lib/docker, and I end up with:
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 250G 0 disk
├─sda1 8:1 0 123M 0 part /boot/efi
├─sda2 8:2 0 3.8G 0 part
├─sda3 8:3 0 14.2G 0 part /var/lib/docker
│ /
├─sda4 8:4 0 19.2G 0 part /var/opt
├─sda5 8:5 0 9.5G 0 part
└─sda6 8:6 0 203.1G 0 part /var/lib/docker
It puts all of Docker's files on the OS partition at that point. (⊙.☉)7
But if I turn Docker off, unmount everything from /var/lib/docker, and then remount \
just sda6 to /var/lib/docker, then when I restart Docker it puts everything on sda6 \
for me like I wanted, and continues to do so on reboots and Docker restarts after \
that…
Everything I find on the web is about how mounting stuff on /var/lib/docker *inside* \
a container will cause all kinds of problems… But that's not what I'm doing… If \
it mangled the mounts every time, I could understand that too. But this seems \
strange. Is there some magic button I'm supposed to push to tell it not to mess with \
its data dir?
Running OpenRC by the way, if that makes a difference.
LMP
[Attachment #3 (text/html)]
<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Segoe UI Symbol";
panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Starting here in case it's something specific to Gentoo since I \
can't find anybody complaining about the behaviour elsewhere on the \
web.<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I'm setting up an image to use Docker, which will be deployed on \
multiple machines. Since the containers will be large, I didn't want them on \
the root partition.<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Ok, easy enough, I just put it in fstab to mount a different \
partition on /var/lib/docker. Presto, now I don't have to worry about a \
container using up all the OS's disk space.<o:p></o:p></p> <p \
class="MsoNormal"><o:p> </o:p></p> <p class="MsoNormal">That's where it gets \
weird.<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Deploy the image, boot it up, everything is mounted \
correctly. But the first time (and ONLY the first time) I start Docker it \
somehow remounts the OS partition onto /var/lib/docker, and I end up with:<br> <br>
# lsblk<o:p></o:p></p>
<p class="MsoNormal">NAME MAJ:MIN RM SIZE RO TYPE \
MOUNTPOINTS<o:p></o:p></p> <p class="MsoNormal">sda \
8:0 0 250G 0 disk<o:p></o:p></p> <p \
class="MsoNormal"><span \
style="font-family:"Arial",sans-serif">├</span>─sda1 \
8:1 0 123M 0 part /boot/efi<o:p></o:p></p> <p \
class="MsoNormal"><span \
style="font-family:"Arial",sans-serif">├</span>─sda2 \
8:2 0 3.8G 0 part<o:p></o:p></p> <p \
class="MsoNormal"><span \
style="font-family:"Arial",sans-serif">├</span>─sda3 \
8:3 0 14.2G 0 part /var/lib/docker<o:p></o:p></p> <p \
class="MsoNormal">│   \
; \
/<o:p></o:p></p> <p class="MsoNormal"><span \
style="font-family:"Arial",sans-serif">├</span>─sda4 \
8:4 0 19.2G 0 part /var/opt<o:p></o:p></p> <p \
class="MsoNormal"><span \
style="font-family:"Arial",sans-serif">├</span>─sda5 \
8:5 0 9.5G 0 part<o:p></o:p></p> <p \
class="MsoNormal">└─sda6 8:6 0 203.1G 0 part \
/var/lib/docker<br> <br>
It puts all of Docker's files on the OS partition at that point. (<span \
style="font-family:"Cambria Math",serif">⊙</span>.<span \
style="font-family:"Segoe UI \
Symbol",sans-serif">☉</span>)7<o:p></o:p></p> <p \
class="MsoNormal"><o:p> </o:p></p> <p class="MsoNormal">But if I turn Docker \
off, unmount everything from /var/lib/docker, and then remount just sda6 to \
/var/lib/docker, then when I restart Docker it puts everything on sda6 for me like I \
wanted, and continues to do so on reboots and Docker restarts after that…<br>
<br>
Everything I find on the web is about how mounting stuff on /var/lib/docker \
*<b>inside</b>* a container will cause all kinds of problems… But that's not \
what I'm doing… If it mangled the mounts every time, I could understand that \
too. But this seems strange. Is there some magic button I'm supposed to \
push to tell it not to mess with its data dir?<br> <br>
Running OpenRC by the way, if that makes a difference.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">LMP<o:p></o:p></p>
</div>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic