cli icon indicating copy to clipboard operation
cli copied to clipboard

Documentation: Correct Dockerfile reference FROM for base images

Open gerald-scharitzer opened this issue 8 years ago • 5 comments

File: engine/reference/builder.md

Description

The Dockerfile reference for the FROM instruction states that

  1. "a valid Dockerfile must start with a FROM instruction" and
  2. "ARG is the only instruction that may precede FROM in the Dockerfile."

The developer guide page on how to Create a base image states that

  • "A base image either has no FROM line in its Dockerfile, or has FROM scratch."

Describe the results you expected:

The Dockerfile reference should

  1. match the description in the developer guide and
  2. refer to "scratch" as an empty image in the repository for this purpose.

Docker Version

18.03

gerald-scharitzer avatar Jul 12 '18 21:07 gerald-scharitzer

Thanks for reporting; I think that passage in the docs originates from base images that are not created using a Dockerfile, but through docker import; it looks like most (if not all) official base images nowadays are created using a Dockerfile (e.g. the busybox image; https://github.com/docker-library/busybox/blob/fe634680e32659aaf0ee0594805f74f332619a90/uclibc/Dockerfile), but it's possible to create an image without using a Dockerfile, and docker import; see this section in the documentation; https://docs.docker.com/develop/develop-images/baseimages/

Perhaps that option doesn't need to be mentioned in the builder documentation (to not confuse readers); open to suggestions if you have any :smile:

/cc @tianon

thaJeztah avatar Jul 16 '18 14:07 thaJeztah

Erm. never mind; I see the passage was in the "create a base image" section; I was confused, and thought it was in "builder"

thaJeztah avatar Jul 16 '18 14:07 thaJeztah

Perhaps it should be changed to;

either has no Dockerfile

(remove no FROM in its)

thaJeztah avatar Jul 16 '18 14:07 thaJeztah

@thaJeztah I'm having a difficult time figuring out what needs to be changed here. Could you please clarify for me? Thanks.

ahh-docker avatar Dec 17 '18 15:12 ahh-docker

looks like this went stale. closing

thaJeztah avatar Apr 22 '25 16:04 thaJeztah