Lesser-Known Dockerfile Instructions and Flags: Heredocs, SHELL, ADD from Git/URLs, COPY --exclude/--parents/--link and Build Checks
Used carefully, the newer Dockerfile flags make a build both shorter and safer: set -eu in heredocs, --checksum on ADD, --parents and --exclude on COPY, RUN --network=none for publish. With real output we show that the frontend's docker/dockerfile:1 tag was still on 1.27.1 on the day of writing and how behaviour changes with 1.29.0, then combine SHELL with pipefail, ONBUILD, build checks and hadolint in Bookstore.Api's new Dockerfile.
15 Nov 2026
·
17 min
·
6