1

The Docker documentation states:

The FROM instruction initializes a new build stage and sets the Base Image for subsequent >instructions. As such, a valid Dockerfile must start with a FROM instruction.

source

However the Dockerfile for httpd starts with:

ADD file:51108b89c70ce0773c897be520c84454660f38b84ba556da49c7fe77e5d52416 in /

source

The official Docker documentation describes the ADD keyword, but it doesn't describe the syntax of file:51108b89c70ce0773c897be520c84454660f38b84ba556da49c7fe77e5d52416. What does file:51108b89c70ce0773c897be520c84454660f38b84ba556da49c7fe77e5d52416 mean? Since it appears to be a SHA256, how can I see the contents of where the SHA256 hash points to? And is it no longer necessary for a Dockerfile to start with the FROM keyword?

Tom
  • 122
  • 2
  • 9
  • `However the Dockerfile for httpd starts with:` No, it doesn't. https://github.com/docker-library/httpd/blob/master/2.4/Dockerfile – tkausl Oct 28 '20 at 12:37
  • @tkausl thank you for pointing me to the Github repo. The Dockerfile on the Github repo shows different instructions compared to the Dockerfile on Dockerhub. Do you know why they differ? – Tom Oct 28 '20 at 12:43
  • 2
    They differ because the link to dockerhub doesn't show a Dockerfile, it shows the image's layers. – tkausl Oct 28 '20 at 12:45
  • 1
    It's an HTML presentation of the `docker history` output, and starts from `ADD`ing a base Linux distribution tarball to a `FROM scratch` image. – David Maze Oct 28 '20 at 12:54

0 Answers0