{"id":1532,"date":"2020-02-24T11:42:56","date_gmt":"2020-02-24T02:42:56","guid":{"rendered":"https:\/\/dennie.tokyo\/it\/?p=1532"},"modified":"2022-03-30T20:03:04","modified_gmt":"2022-03-30T11:03:04","slug":"%e3%80%90docker%e3%80%91docker%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fphp%e9%96%8b%e7%99%ba%e7%92%b0%e5%a2%83%e3%81%ae%e6%a7%8b%e7%af%89","status":"publish","type":"post","link":"https:\/\/dennie.tokyo\/it\/?p=1532","title":{"rendered":"\u3010docker\u3011docker\u30d5\u30a1\u30a4\u30eb\u306e\u8a18\u8ff0\u4f8b &#8211; PHP\u958b\u767a\u74b0\u5883"},"content":{"rendered":"\n<p>centos\uff17\u3078apache\u3001php\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308bdocker\u30d5\u30a1\u30a4\u30eb\u306e\u8a18\u8ff0\u4f8b\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>docker\u30d5\u30a1\u30a4\u30eb\u306b\u3064\u3044\u3066\u306f\u4ee5\u4e0b\u3092\u7406\u89e3\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u524d\u63d0\u3068\u3057\u307e\u3059\u306e\u3067\u3001\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3057\u3066\u304b\u3089\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3093\u3067\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"title_box\"><span class=\"box-title\">\u53c2\u8003<\/span>\n<p><a href=\"https:\/\/dennie.tokyo\/it\/?p=591\" rel=\"noopener noreferrer\" target=\"_blank\">\u3010docker\u3011docker\u30d5\u30a1\u30a4\u30eb\u306b\u3064\u3044\u3066<\/a><\/p>\n<\/div>\n\n\n\n<h1 class=\"wp-block-heading\">dockerfile\u306e\u4f8b<\/h1>\n\n\n\n<p>\u4ee5\u4e0b\u306fdockerfile\u306e\u4f8b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code># \u30a4\u30e1\u30fc\u30b8\nFROM centos:7\n\n# CentOS\u306e\u30ad\u30fc(\u5404\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u5fc5\u8981)\nRUN rpm --import \/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-7\n\n# apache\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nRUN yum -y update\nRUN yum -y install httpd\n\n# PHP\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nRUN yum -y install epel-release\nRUN yum -y update\nRUN yum -y install http:\/\/rpms.famillecollet.com\/enterprise\/remi-release-7.rpm\nRUN yum install --enablerepo=remi,remi-php73 -y php php-common php-mysqlnd php-mbstring php-intl php-mcrypt php-opcache php-xml\n\n#\u30dd\u30fc\u30c880\u3092\u958b\u3051\u308b\nEXPOSE 80\n\n# apache\u3092\u81ea\u52d5\u8d77\u52d5\u3055\u305b\u308b\nRUN RUN systemctl enable httpd\n\n# \u30b3\u30f3\u30c6\u30ca\u8d77\u52d5\u6642 (docker run) \u30b3\u30de\u30f3\u30c9\nCMD [&quot;\/sbin\/init&quot;]<\/code><\/pre><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">dockerfile\u306e\u8aac\u660e<\/h1>\n\n\n\n<p>\u4ee5\u964d\u306f\u3001docker\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u306b\u3064\u3044\u3066\u306e\u8aac\u660e\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d9\u30fc\u30b9\u30a4\u30e1\u30fc\u30b8<\/h2>\n\n\n\n<p>\u4f7f\u7528\u3059\u308b\u30a4\u30e1\u30fc\u30b8\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>&#8220;\u30a4\u30e1\u30fc\u30b8\u540d:\u30bf\u30b0\u540d&#8221;\u3067\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<br>\u30bf\u30b0\u540d\u306f\u7701\u7565\u53ef\u80fd\u3067\u3059\u3002<br>\u4ee5\u4e0b\u306e\u4f8b\u306f <a rel=\"noopener noreferrer\" href=\"https:\/\/hub.docker.com\/\" target=\"_blank\">docker hub<\/a> \u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308bcentos:7\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>FROM centos:7<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">apache\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p>docker \u306e RUN \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066 apache\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code># apache\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nRUN yum -y update\nRUN yum -y install httpd<\/code><\/pre><\/div>\n\n\n\n<p>centos\u3078apache\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u3092\u3001RUN\u30b3\u30de\u30f3\u30c9\u3067\u5b9f\u884c\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<br>centos\u3078apache\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u306f\u4ee5\u4e0b\u3092\u53c2\u7167\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"title_box\"><span class=\"box-title\">\u53c2\u8003<\/span>\n<p><a href=\"https:\/\/dennie.tokyo\/it\/?p=1177\" rel=\"noopener noreferrer\" target=\"_blank\">apache\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/p>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">PHP\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p>docker \u306e RUN \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066 php\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code># PHP\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nRUN yum -y install epel-release\nRUN yum -y update\nRUN yum -y install http:\/\/rpms.famillecollet.com\/enterprise\/remi-release-7.rpm\nRUN yum install --enablerepo=remi,remi-php73 -y php php-common php-mysqlnd php-mbstring php-intl php-mcrypt php-opcache php-xml<\/code><\/pre><\/div>\n\n\n\n<p>centos\u3078php\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u3092\u3001RUN\u30b3\u30de\u30f3\u30c9\u3067\u5b9f\u884c\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<br>centos\u3078php\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u306f\u4ee5\u4e0b\u3092\u53c2\u7167\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"title_box\"><span class=\"box-title\">\u53c2\u8003<\/span>\n<p><a href=\"https:\/\/dennie.tokyo\/it\/?p=70\" rel=\"noopener noreferrer\" target=\"_blank\">php\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/p>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u30dd\u30fc\u30c8\u306e\u6307\u5b9a<\/h2>\n\n\n\n<p>apache\u304c\u30dd\u30fc\u30c880\u3092\u4f7f\u7528\u3059\u308b\u306e\u3067\u3001\u30dd\u30fc\u30c880\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>EXPOSE 80<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">apache\u306e\u8d77\u52d5<\/h2>\n\n\n\n<p>docker run \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u6642\u306bapache\u3092\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code># apache\u3092\u81ea\u52d5\u8d77\u52d5\u3055\u305b\u308b\nRUN systemctl enable httpd\n\n# \u30b3\u30f3\u30c6\u30ca\u8d77\u52d5\u6642 (docker run) \u30b3\u30de\u30f3\u30c9\nCMD [&quot;\/sbin\/init&quot;]<\/code><\/pre><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">\u6700\u5f8c\u306b<\/h1>\n\n\n\n<p>\u6b21\u56de\u306f\u4eca\u56de\u8aac\u660e\u3057\u305fdocker\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3001php\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"title_box\"><span class=\"box-title\">\u6b21\u56de<\/span>\n<p><a href=\"https:\/\/dennie.tokyo\/it\/?p=455\" rel=\"noopener noreferrer\" target=\"_blank\">\u3010docker\u3011docker\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3057\u305fPHP\u306e\u74b0\u5883\u69cb\u7bc9<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>centos\uff17\u3078apache\u3001php\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308bdocker\u30d5\u30a1\u30a4\u30eb\u306e\u8a18\u8ff0\u4f8b\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":968,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1532","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/1532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1532"}],"version-history":[{"count":22,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/1532\/revisions"}],"predecessor-version":[{"id":3279,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/1532\/revisions\/3279"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/media\/968"}],"wp:attachment":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}