Running additional commands on Docker image startup
Simply write a Dockerfile which uses that image as a base. Then you can replace individual files (like the entrypoint) easily.

Also, instead of replacing, you could rename the original entry script, create your own, which does whatever it needs to do, and then just calls the original.

Somewhat like this:


Dockerfile:

FROM fancy-base-image:1.2.3
RUN mv docker-entrypoint.sh docker-entrypoint-original.sh
ADD docker-entrypoint.sh

docker-entrypoint.sh:

#!/bin/bash
echo Do something.
./docker-entrypoint-original.sh
echo Do something else



Obviously this is just a fake example, you'll have to adjust for directory and file names and such.