Is `FROM` clause required in Dockerfile?

后端 未结 3 1152
清酒与你
清酒与你 2021-01-15 01:38

For all the Dockerfiles I\'ve come across thus (which admittedly is not many), all of them have used a FROM clause to base off an existing image, even if it\'s

3条回答
  •  萌比男神i
    2021-01-15 02:30

    Yes, it is. It defines the layers on which the image you are building is based on. If you want to start an image from scratch docker offers an image called scratch

    The documentation also says:

    A parent image is the image that your image is based on

    also

    A base image has FROM scratch in its Dockerfile.

    Refer to base images documentation

提交回复
热议问题