Junior — Middle
Which directive is mandatory for writing a Dockerfile?
sobes.tech AI
Answer from AI
The mandatory directive in a Dockerfile is the FROM directive. It specifies the base image from which the new image will be built. Without FROM, Docker will not understand where to start building the container.
Example:
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y curl