Is `FROM` clause required in Dockerfile?

后端 未结 3 1132
清酒与你
清酒与你 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条回答
  •  逝去的感伤
    2021-01-15 02:14

    Based on the official documentation it's required:

    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. The image can be any valid image – it is especially easy to start by pulling an image from the Public Repositories.

    https://docs.docker.com/engine/reference/builder/#from

提交回复
热议问题