These Dockerfile
examples demonstrate two options for running a script at container startup, then running the main container process. The example script downloads index.html
from https://example.com/ and writes it into Tomcat webapps directory. The index.html
is then served by the container at http://localhost:8080/default-app/.
docker build . -t tomcat-with-startup
docker run --rm -it -p 8080:8080 tomcat-with-startup