Your question is Dockerfile Best Practices. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
Which Dockerfile follows better practices regarding layer optimization and package cleaning: chaining RUN commands with apk update/add and curl vs multiple separate RUN steps?
Asked in the CoderPad Online Assessment stage.
Explain which structure you would choose and why. Address Docker image layers, Alpine package indexes, temporary packages, curl usage, cache cleanup, reproducibility, and how you would validate the resulting image. You may mention when a multi-stage build is preferable.