What is the purpose of Dockerfile’s ONBUILD instruction and when is it useful?

Docker Fundamentals Hard

Docker Fundamentals — Hard

What is the purpose of Dockerfile’s ONBUILD instruction and when is it useful?

Key points

  • ONBUILD triggers setup steps in child images
  • Prevents repetition of setup steps in child Dockerfiles
  • Executes when image is used as a base image

Ready to go further?

Related questions