# ONBUILD

> What is the ONBUILD instruction in a Dockerfile, when does it run, and why is it rarely used today?

Canonical: https://www.internhack.in/learn/interview/docker-containers/docker-onbuild-instruction
Last updated: 2026-11-28

Difficulty: Advanced

## Question

What is the ONBUILD instruction in a Dockerfile, when does it run, and why is it rarely used today?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

ONBUILD, Build Triggers, Base Images, Dockerfile Inheritance

Previous: [Pause/Unpause](https://www.internhack.in/learn/interview/docker-containers/docker-pause-unpause) · Next: [Multi-platform Build](https://www.internhack.in/learn/interview/docker-containers/docker-multi-platform-builds) · [All of Docker & Containers](https://www.internhack.in/learn/interview/docker-containers)

## More Docker & Containers questions

- [Volume Drivers](https://www.internhack.in/learn/interview/docker-containers/docker-volume-drivers)
- [Pruning Networks](https://www.internhack.in/learn/interview/docker-containers/docker-network-prune)
- [Stats Streaming](https://www.internhack.in/learn/interview/docker-containers/docker-container-stats-stream)
- [Logging Drivers](https://www.internhack.in/learn/interview/docker-containers/docker-logging-drivers)
- [Interactive Terminal](https://www.internhack.in/learn/interview/docker-containers/docker-run-it-meaning)
- [Removing Volumes with Containers](https://www.internhack.in/learn/interview/docker-containers/docker-rm-v-flag)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Docker & Containers](https://www.internhack.in/learn/interview/docker-containers)
