title: confused by `no space left on device` exception
body: <p>I came across an exception</p>
  
  <pre><code>openj9-openjdk-jdk9/.git/HEAD
  Error processing tar file(exit status 1): write /root/openj9-openjdk-jdk9/.git/objects/pack/pack-203ba520304c417be0828d545d85ffd13566ac41.pack: no space left on device
  </code></pre>
  
  <p>and a popup diagram said '/root' is only 672M available, when executing command: </p>
  
  <pre><code>docker build -t openj9 -f Dockerfile .
  </code></pre>
  
  <p>The Dockerfile is</p>
  
  <pre><code>FROM ubuntu:16.04
  
  RUN apt-get update \
    &amp;&amp; apt-get install -qq -y --no-install-recommends \
      autoconf \
      ca-certificates \
      ccache \
      cpio \
      file \
      g++-4.8 \
      gcc-4.8 \
      git \
      git-core \
      libasound2-dev \
      libcups2-dev \
      libelf-dev \
      libfreetype6-dev \
      libnuma-dev \
      libx11-dev \
      libxext-dev \
      libxrender-dev \
      libxt-dev \
      libxtst-dev \
      make \
      openjdk-8-jdk \
      pkg-config \
      realpath \
      ssh \
      unzip \
      wget \
      zip \
    &amp;&amp; rm -rf /var/lib/apt/lists/*
  
  COPY openj9-openjdk-jdk9.tar.gz    /root/
  COPY  freemarker.tgz  /root/
  # Create links for c++,g++,cc,gcc
  RUN ln -s g++ /usr/bin/c++ \
    &amp;&amp; ln -s g++-4.8 /usr/bin/g++ \
    &amp;&amp; ln -s gcc /usr/bin/cc \
    &amp;&amp; ln -s gcc-4.8 /usr/bin/gcc
  
  # Download and setup freemarker.jar to /root/freemarker.jar
  RUN cd /root \
  #  &amp;&amp; wget https://sourceforge.net/projects/freemarker/files/freemarker/2.3.8/freemarker-2.3.8.tar.gz/download -O freemarker.tgz \
    &amp;&amp; tar -xzf freemarker.tgz freemarker-2.3.8/lib/freemarker.jar --strip=2 \
    &amp;&amp; rm -f freemarker.tgz \
    &amp;&amp; tar xvf openj9-openjdk-jdk9.tar.gz \
    &amp;&amp; rm -f openj9-openjdk-jdk9.tar.gz
  
  WORKDIR /root
  </code></pre>
  
  <p>The error happens when executing <code>tar xvf openj9-openjdk-jdk9.tar.gz</code>. </p>
  
  <p>What confuse me is that the partition where the directory <code>/root</code> resides still has a large space i.e., 4.3G, as shown below. </p>
  
  <pre><code>Filesystem      Size  Used Avail Use% Mounted on
  udev            3.8G     0  3.8G   0% /dev
  tmpfs           778M   78M  701M  10% /run
  /dev/sda1        32G   27G  4.3G  86% /
  tmpfs           3.8G  113M  3.7G   3% /dev/shm
  tmpfs           5.0M  4.0K  5.0M   1% /run/lock
  tmpfs           3.8G     0  3.8G   0% /sys/fs/cgroup
  /dev/loop0       90M   90M     0 100% /snap/core/6673
  /dev/loop1       90M   90M     0 100% /snap/core/6818
  /dev/loop2      141M  141M     0 100% /snap/webdingding/1
  /dev/loop3       92M   92M     0 100% /snap/core/6531
  /dev/loop4      254M  254M     0 100% /snap/electronic-wechat/7
  /dev/sda6        31G  1.1G   29G   4% /opt
  /dev/sda5        38G   25G   11G  71% /home
  /dev/sdb7        52G   25G   25G  50% /home_bak
  /dev/sdb5        37G   28G  7.4G  79% /backup
  /dev/sdb8        81G   68G  8.8G  89% /opt1
  /dev/sdb6        97G   72G   20G  79% /other
  cgmfs           100K     0  100K   0% /run/cgmanager/fs
  tmpfs           778M  172K  778M   1% /run/user/1000
  </code></pre>
  
  <p>So, my two main questions are: </p>
  
  <ol>
  <li><p>How to understand the path in the container? Is the container path <code>/root</code> is the same as the absolute path <code>/root</code> in the host machine, or is it mapped to some other paths in the host machine? </p></li>
  <li><p>The solution for the problem. I tried <a href="https://success.docker.com/article/no-space-left-on-device-error" rel="nofollow noreferrer">this one</a>, but failed. As the container log file was very small</p>
  
  <p>root@shijie:~# du -d1 -h /var/lib/docker/containers</p>
  
  <pre><code>40K /var/lib/docker/containers/f41f43b5a4372dda5e2aba71c3ae8cc58170b2f13183e22942fa62747910ac7a
  44K /var/lib/docker/containers
  </code></pre></li>
  </ol>
  
  <hr>
  
  <p><strong>[Update]</strong>
  I also cleared the <code>containers</code> and <code>images</code>, and then re-execute the command, and the result is the same. </p>
  
  <p><code>sudo docker ps -a</code></p>
  
  <pre><code>CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                   PORTS               NAMES
  f41f43b5a437        b68439663072        "/bin/sh -c 'cd /roo…"   2 hours ago         Exited (0) 2 hours ago                       brave_albattani
  </code></pre>
  
  <p><code>sudo docker rm f41f43b5a437</code>
  <code>sudo docker images</code> </p>
  
  <pre><code>   REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
      &lt;none&gt;              &lt;none&gt;              b68439663072        2 hours ago         1.66GB
      ubuntu              16.04               a3551444fc85        2 weeks ago         119MB
  </code></pre>
  
  <p><code>sudo docker rmi b68439663072 a3551444fc85</code></p>
  
  <p><code>sudo docker images -aq -f 'dangling=true'</code>    ## No dangling images..</p>
  
  <p><a href="https://i.stack.imgur.com/tZ6Ed.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tZ6Ed.png" alt="popup diagram"></a></p>