How do you print to console from a docker file during build?

It’s fairly simple actually.
If you just want to print stuff using in the build proccess you could just add the following line to your Dockerfile:

RUN echo "hello there"

And then add these options to your docker build command:

--progress=plain --no-cache

EDIT:

as noted by @SoftwareEngineer, when used for logging or tooling purposes you should append the echo command to the one you want to check if were successful. for example when downloading packages and wanting to get a print statement when finished:
example from nginx official image dockerfile

RUN apt-get install -y whatever && echo "installed package"

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)