Created
October 23, 2019 20:36
-
-
Save hakre/20cfe525fe927af00ab6b1e895fa8acc to your computer and use it in GitHub Desktop.
Docker Run without "docker run"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<<'EOD' docker build --rm --tag rewrite-tester --no-cache - | |
FROM httpd:alpine | |
RUN set -e \ | |
; sed -i -e 's/^#LoadModule rewrite_module/LoadModule rewrite_module/' \ | |
-e 's/^LogLevel .*$/LogLevel debug rewrite:trace8/' \ | |
-e '\|<Directory "/usr/local/apache2/htdocs">|,\ </Directory> s/^ AllowOverride .*$/ AllowOverride All/' \ | |
/usr/local/apache2/conf/httpd.conf \ | |
; echo -e ' \n\ | |
RewriteEngine On \n\ | |
RewriteBase / \n\ | |
RewriteCond %{REQUEST_URI} \.(gif|jpg|jpeg|png)$ \n\ | |
RewriteRule ^(.*)$ $1?i=jplx [DPI,QSA] \n\ | |
RewriteCond %{REQUEST_URI} !^/sites/default/files/js/ \n\ | |
RewriteCond %{REQUEST_URI} !^/sites/default/files/css/ \n\ | |
RewriteRule ^sites/default/files/(.*)$ index.php?q=system/files/$1 [END,QSA,R] \n\ | |
' | tee /usr/local/apache2/htdocs/.htaccess \ | |
; httpd-foreground & sleep 1 \ | |
; apk add curl \ | |
; curl -I 'http://127.0.0.1/sites/default/files/Slide074.png?abc' \ | |
; exit 123 | |
EOD | |
;: https://stackoverflow.com/a/58527089/367456 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment