{"id":1409,"date":"2017-08-17T18:41:06","date_gmt":"2017-08-17T22:41:06","guid":{"rendered":"http:\/\/www.xavignu.com\/?p=1409"},"modified":"2017-08-17T18:43:11","modified_gmt":"2017-08-17T22:43:11","slug":"run-httpd-with-docker","status":"publish","type":"post","link":"https:\/\/www.xavignu.com\/?p=1409","title":{"rendered":"Run httpd with docker"},"content":{"rendered":"<p>So below is the script:<br \/>\n[bash]<br \/>\n#!\/bin\/bash<\/p>\n<p>echo &#8220;Running httpd with docker.&#8221;<\/p>\n<p>docker run   &#8211;rm -v &#8220;$PWD&#8221;:\/usr\/local\/apache2\/htdocs  httpd<br \/>\n[\/bash]<br \/>\nWe use the following options:<br \/>\n-v, &#8211;volume list                    Bind mount a volume<br \/>\n&#8211;rm                             Automatically remove the container when it exits<\/p>\n<p>Quite simple, right? Execution below.<\/p>\n<pre id=\"terminal\"> bash ~\/docker\/run_httpd.sh\r\nRunning httpd with docker.\r\nAH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.6. Set the 'ServerName' directive globally to suppress this message\r\nAH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.6. Set the 'ServerName' directive globally to suppress this message\r\n[Thu Aug 17 22:22:55.249981 2017] [mpm_event:notice] [pid 1:tid 140029488904064] AH00489: Apache\/2.4.27 (Unix) configured -- resuming normal operations\r\n[Thu Aug 17 22:22:55.250079 2017] [core:notice] [pid 1:tid 140029488904064] AH00094: Command line: 'httpd -D FOREGROUND'\r\n<\/pre>\n<p>And we proceed to test.<\/p>\n<pre id=\"terminal\"> curl   http:\/\/172.17.0.6\r\n&lt;HTML&gt;\r\n&lt;HEAD&gt;\r\nFirst page\r\n&lt;\/HEAD&gt;\r\n&lt;BODY&gt;\r\nTesting docker httpd\r\n<\/BODY>\r\n<\/HTML>\r\n<\/pre>\n<p>We are getting below index.html because we are mapping \/tmp\/httpd (current $PWD) to \/usr\/local\/apache2\/htdocs. In \/tmp\/httpd we created an example index.html as shown above.<br \/>\nMore info <a href=\"https:\/\/docs.docker.com\/samples\/library\/httpd\/\" target=\"_blank\">here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So below is the script: [bash] #!\/bin\/bash echo &#8220;Running httpd with docker.&#8221; docker run &#8211;rm -v &#8220;$PWD&#8221;:\/usr\/local\/apache2\/htdocs httpd [\/bash] We use the following options: -v, &#8211;volume list Bind mount a volume &#8211;rm Automatically remove the container when it exits Quite simple, right? Execution below. bash ~\/docker\/run_httpd.sh Running httpd with docker. AH00558: httpd: Could not reliably [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3],"tags":[83,6,70],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/pTQgt-mJ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/1409"}],"collection":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1409"}],"version-history":[{"count":9,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/1409\/revisions"}],"predecessor-version":[{"id":1418,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/1409\/revisions\/1418"}],"wp:attachment":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}