Checking File Changes in Docker Build

May 23, 2023

I'm working on dockerising some existing PHP applications. Sometimes we need to change the PHP source that we're provided with to make it work in the dockerised environment.

It's useful to protect ourselves from changes to this file - we want the docker build to fail if the file has been modified by the development teams, as our overwrite of the file may also need to change.

This can be achieved with the following command:

RUN echo "000469681ed179e9c54039303f901a28d2e12345 /home/app/www/.htaccess" | sha1sum -c