Docker Run without “docker run”

So there was this one question on Stackoverflow in which the OP was linking an .htaccess tester for Mod-Rewrite-Rules. Despite this being all fine I was asking myself what about really(tm) testing this?

So I remembered the rewrite-log from the days ago and thought: Why not just fire up a docker container, do the setup for testing rewrites by turning the logs to screaming and give it a drive.

But all the setup.

So I had an idea: What about you put the whole example into the Dockerfile? It has the RUN directive, so the moment the image builds it is actually executing it.

Having it exit non-zero even prevents of storing the image locally.

Ah yeah, and why actually write a Dockerfile even.

Explainshell

This also clearly highlights a missing feature in docker: no support for here-doc strings in the Dockerfile since 2013, echo -e to the rescue (but it’s cumbersome).

This entry was posted in Hakre's Tips, Patched, Pressed, Professional Webdevelopers At Work, Scripts, Surviving the Internet, Tools, Uncategorized and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.