advancedTop 100 Interview Questions
How do you pass a build secret without leaking it into image layers?
Use BuildKit's `--mount=type=secret` in a RUN instruction, which makes the secret available only during that specific RUN step's execution and never writes it into any image layer — unlike an ARG or ENV value, which would persist in the image history/metadata.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response