{"id":1150,"date":"2019-06-01T17:39:12","date_gmt":"2019-06-01T14:39:12","guid":{"rendered":"https:\/\/artem.services\/?p=1150"},"modified":"2019-06-01T21:14:00","modified_gmt":"2019-06-01T18:14:00","slug":"docker-mysql-8-%d1%81%d0%be%d0%b7%d0%b4%d0%b0%d0%bd%d0%b8%d0%b5-%d0%be%d0%b1%d1%80%d0%b0%d0%b7%d0%b0-%d1%81-%d0%b4%d0%b0%d0%bc%d0%bf%d0%be%d0%bc","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=1150","title":{"rendered":"Docker &#8212; MySQL 8 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u0430 \u0441 \u0434\u0430\u043c\u043f\u043e\u043c"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-27\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo.png\" alt=\"\" width=\"1800\" height=\"531\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo.png 1800w, https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo-300x89.png 300w, https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo-768x227.png 768w, https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo-1024x302.png 1024w, https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo-954x281.png 954w, https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo-1354x399.png 1354w\" sizes=\"(max-width: 1800px) 100vw, 1800px\" \/><\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043e\u043a\u0435\u0440 \u043e\u0431\u0440\u0430\u0437\u0430 <strong>MySQL 8<\/strong> \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441 \u0434\u0430\u043c\u043f \u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435:<\/p>\n<ul>\n<li>Dockerfile<\/li>\n<li>mysqld.cnf<\/li>\n<li>dump.sql<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>Dockerfile:<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nFROM mysql:8\r\n\r\nRUN apt update &amp;&amp; \\\r\n    apt install -y psmisc\r\n\r\nENV MYSQL_ROOT_PASSWORD MyRootPassword\r\nENV MYSQL_DATABASE artem_db\r\nENV MYSQL_USER database_user\r\nENV MYSQL_PASSWORD MyUserPassword\r\n\r\nCOPY dump.sql \/docker-entrypoint-initdb.d\/db.sql\r\nCOPY my.cnf \/etc\/mysql\/my.cnf\r\nRUN \/entrypoint.sh mysqld &amp;; sleep 30 &amp;&amp; killall mysqld\r\nRUN rm \/docker-entrypoint-initdb.d\/db.sql\r\n<\/pre>\n<p>&nbsp;<\/p>\n<blockquote><p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 &quot;<strong>MYSQL_USER<\/strong>&quot; \u0438 &quot;<strong>MYSQL_PASSWORD<\/strong>&quot; \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0432 <strong>Dockerfile<\/strong><\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 &quot;<strong>my.cnf<\/strong>&quot; \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 <strong>MySQL<\/strong><\/p>\n<h3>mysqld.cnf<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# Copyright (c) 2017, Oracle and\/or its affiliates. All rights reserved.\r\n#\r\n# This program is free software; you can redistribute it and\/or modify\r\n# it under the terms of the GNU General Public License as published by\r\n# the Free Software Foundation; version 2 of the License.\r\n#\r\n# This program is distributed in the hope that it will be useful,\r\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n# GNU General Public License for more details.\r\n#\r\n# You should have received a copy of the GNU General Public License\r\n# along with this program; if not, write to the Free Software\r\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA\r\n\r\n#\r\n# The MySQL  Server configuration file.\r\n#\r\n# For explanations see\r\n# http:\/\/dev.mysql.com\/doc\/mysql\/en\/server-system-variables.html\r\n\r\n[mysqld]\r\npid-file        = \/var\/run\/mysqld\/mysqld.pid\r\nsocket          = \/var\/run\/mysqld\/mysqld.sock\r\ndatadir         = \/var\/lib\/mysql\r\nsecure-file-priv= NULL\r\n# Disabling symbolic-links is recommended to prevent assorted security risks\r\nsymbolic-links=0\r\n\r\n# Custom config should go here\r\n!includedir \/etc\/mysql\/conf.d\/\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u041f\u0443\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ndatadir\t\t= \/var\/lib\/mysql\r\n<\/pre>\n<p>\u041d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0443\u0442\u044c:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ndatadir\t\t= \/var\/lib\/mysql_artem_service\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u0418 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ndocker build -t artem_db .\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043e\u043a\u0435\u0440 \u043e\u0431\u0440\u0430\u0437\u0430 MySQL 8 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441 \u0434\u0430\u043c\u043f \u0444\u0430\u0439\u043b\u0430. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435: Dockerfile mysqld.cnf dump.sql &nbsp; Dockerfile: &nbsp; \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 &quot;MYSQL_USER&quot; \u0438 &quot;MYSQL_PASSWORD&quot; \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0432 Dockerfile &nbsp; \u0412 \u0444\u0430\u0439\u043b\u0435 &quot;my.cnf&quot; \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 MySQL mysqld.cnf &nbsp; \u041f\u0443\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435: \u041d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0443\u0442\u044c: &nbsp; \u0418 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[4,811,145,901],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1150"}],"collection":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1150"}],"version-history":[{"count":7,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1150\/revisions"}],"predecessor-version":[{"id":1159,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1150\/revisions\/1159"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}