title: Docker image layer: What does `ADD file:<some_hash> in /` mean?
body: <p>In Docker Hub images there are <strong>lists of commands</strong> that being run for each <strong>image layer</strong>. Here is a golang <a href="https://hub.docker.com/layers/golang/library/golang/1.15.2/images/sha256-5976acadfa9ccd05b6950c709c1dc99c8a4f3068ea71150cb143f16c4c83ca04?context=explore" rel="noreferrer">example</a>.</p>
  <p>Some applications also provide their <strong>Dockerfile</strong> in GitHub. Here is a golang <a href="https://github.com/docker-library/golang/blob/master/Dockerfile-debian.template" rel="noreferrer">example</a>.</p>
  <p>According to the Docker Hub image layer, <code>ADD file:4b03b5f551e3fbdf47ec609712007327828f7530cc3455c43bbcdcaf449a75a9 in /</code> is the first command. The image layer doesn't have any &quot;FROM&quot; command included, and it doesn't seem to be suffice the <a href="https://docs.docker.com/engine/reference/builder/#add" rel="noreferrer">ADD definition</a> too.</p>
  <p>So here are the questions:</p>
  <ol>
  <li>What does <code>ADD file:&lt;HASH&gt; in /</code> means? What is this format?</li>
  <li>Is there any way I could trace upwards using the hash? I suppose that hash represents the <code>FROM</code> image, but it seems there are no API for that.</li>
  <li>Why it is not possible to build a dockerfile using the <code>ADD file:&lt;HASH&gt; in /</code> syntax? Is there any way I could build an image using such syntax, OR do a conversion between two format?</li>
  </ol>