{"id":558,"date":"2017-03-21T16:03:29","date_gmt":"2017-03-21T10:33:29","guid":{"rendered":"http:\/\/www.cyberaka.com\/?p=558"},"modified":"2017-03-21T16:03:29","modified_gmt":"2017-03-21T10:33:29","slug":"setting-up-mysql-docker-instance","status":"publish","type":"post","link":"https:\/\/www.cyberaka.com\/?p=558","title":{"rendered":"Setting up MySQL docker instance"},"content":{"rendered":"<p>In order to setup a fully functional MySQL server via docker I use the following consolidated command:<br \/>\n<code><br \/>\ndocker run \\<br \/>\n--detach \\<br \/>\n--name=mysql \\<br \/>\n--env=\"MYSQL_ROOT_PASSWORD=abcd1234\" \\<br \/>\n--publish 6603:3306 \\<br \/>\n--volume=~\/Docker\/mysql\/conf.d:\/etc\/mysql\/conf.d \\<br \/>\n--volume=~\/Docker\/mysql\/mysql-datadir:\/var\/lib\/mysql \\<br \/>\nmysql<br \/>\n<\/code><\/p>\n<p>The advantage of the above approach is that the configuration files can be defined under ~\/Docker\/mysql\/conf.d folder on my  system and it will be picked up whenever I bootup this instance. The second thing is that all information written by this instance will be stored outside of VM in the path ~\/Docker\/mysql\/mysql-datadir on my system. So In case this VM goes away due to some unexplained reasons I can still bootup another docker instance of MySQL and point it to this data directory. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In order to setup a fully functional MySQL server via docker I use the following consolidated command: docker run \\ &#8211;detach \\ &#8211;name=mysql \\ &#8211;env=&#8221;MYSQL_ROOT_PASSWORD=abcd1234&#8243; \\ &#8211;publish 6603:3306 \\ &#8211;volume=~\/Docker\/mysql\/conf.d:\/etc\/mysql\/conf.d \\ &#8211;volume=~\/Docker\/mysql\/mysql-datadir:\/var\/lib\/mysql \\ mysql The advantage of the above approach is that the configuration files can be defined under ~\/Docker\/mysql\/conf.d folder on my system and [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[],"class_list":["post-558","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=558"}],"version-history":[{"count":1,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/558\/revisions"}],"predecessor-version":[{"id":559,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/558\/revisions\/559"}],"wp:attachment":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}