There’s no builtin way for Docker to print the WORKDIR during a build. You can inspect the final workdir for an image/layer via the .Config.WorkingDir property in the inspect output:
docker image inspect -f '{{.Config.WorkingDir}}' {image-name}
It’s possible to view a Linux containers build steps workdir by printing the shells default working directory:
RUN pwd
or the shell often stores the working directory in the PWD environment variable
RUN echo "$PWD"
If you are using newer versions of docker with BuildKit, stdout will need to be enabled with --progress=plain
docker build --progress=plain .