{"id":4380,"date":"2014-07-26T00:16:27","date_gmt":"2014-07-25T15:16:27","guid":{"rendered":"http:\/\/www.vincentina.net\/?p=4380"},"modified":"2020-02-23T17:25:36","modified_gmt":"2020-02-23T08:25:36","slug":"redmine%e3%81%aedockerfile%e3%81%8c%e3%82%84%e3%81%a3%e3%81%a8%e3%81%a7%e3%81%8d%e3%81%9f","status":"publish","type":"post","link":"https:\/\/www.vincentina.net\/?p=4380","title":{"rendered":"redmine\u306eDockerfile\u304c\u3084\u3063\u3068\u3067\u304d\u305f"},"content":{"rendered":"<p>\u3061\u3087\u3063\u3068\u3060\u3051<span style=\"font-size: 12pt;\"><strong>\u3053\u306a\u308c\u3066\u304d\u305f<\/strong><\/span>\u306e\u3067wordpress\u306b\u7d9a\u3044\u3066\u3001\u4eca\u5ea6\u306f\u308f\u308a\u3068\u81ea\u529b\u3067redmine\u306eDocerfile\u3092\u4f5c\u3063\u3066\u307f\u305f\u3002\u30a4\u30e1\u30fc\u30b8\u306a\u3089Docker Hub\u306b\u3042\u308b\u3093\u3060\u3051\u3069\u3001\u3084\u3063\u3071\u308a\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u76ee\u6307\u3059\u306a\u3089\u81ea\u5206\u3067\u4f5c\u3063\u3066\u307f\u305f\u3044\u3058\u3083\u306a\u3044\u3002<br \/>\nCentOS\u306bredmine\u3092\u5165\u308c\u308bHow to \u3067\u3001\u624b\u9806\u306e\u30d9\u30fc\u30b9\u306b\u3057\u305f\u30b5\u30a4\u30c8\u306f\u3053\u3061\u3089<\/p>\n<p><a href=\"http:\/\/blog.redmine.jp\/articles\/2_5\/installation_centos\/\" target=\"_blank\" rel=\"noopener noreferrer\">redmine.jp Blog<\/a> \u3055\u3093<\/p>\n<p>\u4eca\u56de\u3082\u3082\u3061\u308d\u3093\u8272\u3005\u3068\u30b0\u30b0\u3063\u3066\u8a66\u884c\u932f\u8aa4\u3057\u306a\u304c\u3089\u4f5c\u3063\u305f\u3093\u3060\u3051\u3069\u3001<strong><span style=\"font-size: 12pt;\">\u898b\u3066\u3044\u308b\u306e\u304c\u81ea\u5206\u306e\u30b5\u30a4\u30c8<\/span><\/strong>\u3068\u6c17\u3065\u304b\u305a\u306b\u81ea\u5206\u306e\u30b5\u30a4\u30c8\u3092\u8aad\u3093\u3067\u3044\u305f\u30de\u30cc\u30b1\u3061\u3083\u3093\u306f\u4eca\u56de\u304c\u521d\u3081\u3066\u304b\u3082\u30fb\u30fb\u30fb\u3002<br \/>\n\u8a66\u884c\u932f\u8aa4\u306e\u3088\u3046\u306aDockerfile\u306a\u306e\u3067\u898b\u305f\u76ee\u3068\u304b\u30d7\u30ed\u30c8\u30bf\u30a4\u30d7\u7684\u306a\u3068\u3053\u308d\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u3068\u308a\u3042\u3048\u305a\u516c\u958b\u3002<\/p>\n<p>\u74b0\u5883\u304b\u3089<\/p>\n<pre>\u00a0$ cat \/etc\/os-release\r\nNAME=CoreOS\r\nID=coreos\r\nVERSION=386.1.0\r\nVERSION_ID=386.1.0\r\nBUILD_ID=\r\nPRETTY_NAME=\"CoreOS 386.1.0\"\r\nANSI_COLOR=\"1;32\"\r\nHOME_URL=\"https:\/\/coreos.com\/\"\r\nBUG_REPORT_URL=\"https:\/\/github.com\/coreos\/bugs\/issues\"<\/pre>\n<pre>\u00a0$ docker version\r\nClient version: 1.1.1\r\nClient API version: 1.13\r\nGo version (client): go1.2\r\nGit commit (client): dc62f3c\r\nServer version: 1.1.1\r\nServer API version: 1.13\r\nGo version (server): go1.2\r\nGit commit (server): dc62f3c<\/pre>\n<p>Dockerfile<\/p>\n<pre>$ cat docker-redmine\/conf\/Dockerfile\r\nFROM centos:centos6\r\n\r\nMAINTAINER takeken\r\n\r\n# yum + repo\r\nRUN yum install -y wget\r\nRUN yum install -y sudo tar openssh openssh-clients openssh-server syslog httpd httpd-devel mysql-server vim python-setuptools\r\nRUN sleep 60\r\nRUN wget http:\/\/rpms.famillecollet.com\/enterprise\/remi-release-6.rpm ;\\\r\n\u00a0\u00a0\u00a0 wget http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm ;\\\r\n\u00a0\u00a0\u00a0 wget http:\/\/pkgs.repoforge.org\/rpmforge-release\/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm ;\\\r\n\u00a0\u00a0\u00a0 rpm -ivh epel-release-6-8.noarch.rpm remi-release-6.rpm rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm\r\nRUN yum --enablerepo=remi,epel groupinstall -y \"Development Tools\"\r\nRUN yum --enablerepo=remi,epel,centosplus install -y openssl-devel readline-devel zlib-devel curl-devel libyaml-devel ImageMagick ImageMagick-devel ipa-pgothic-fonts mysql-devel\r\n\r\n# ssh\r\nRUN sed -ri 's\/UsePAM yes\/#UsePAM yes\/g' \/etc\/ssh\/sshd_config\r\nRUN sed -ri 's\/#UsePAM no\/UsePAM no\/g' \/etc\/ssh\/sshd_config\r\nRUN ssh-keygen -t rsa -f \/etc\/ssh\/ssh_host_rsa_key\r\nRUN ssh-keygen -t dsa -f \/etc\/ssh\/ssh_host_dsa_key\r\nRUN useradd takeken\r\nRUN echo 'takeken:takeken' | chpasswd\r\nRUN echo 'takeken ALL=(ALL) NOPASSWD:ALL' &gt;&gt; \/etc\/sudoers.d\/takeken\r\n\r\n# ruby\r\nRUN curl http:\/\/cache.ruby-lang.org\/pub\/ruby\/2.0\/ruby-2.0.0-p451.tar.gz | tar -xz -C \/tmp\r\nRUN cd \/tmp\/ruby-2.0.0-p451 ; .\/configure --disable-install-doc &amp;&amp; make &amp;&amp; make install\r\nRUN cd \/tmp\/ruby-2.0.0-p451\/ext\/openssl ; ruby extconf.rb ; make ; make install\r\nRUN cd \/tmp\/ruby-2.0.0-p451\/ext\/zlib ; ruby extconf.rb ; make ; make install\r\nRUN gem install bundler --no-rdoc --no-ri\r\n\r\n# setting\r\n# RUN sed -ri \"s\/^SELINUX=enforcing\/SELINUX=disabled\/\" \/etc\/sysconfig\/selinux\r\n\r\n# supervisor\r\nRUN easy_install supervisor\r\nRUN echo_supervisord_conf &gt; \/etc\/supervisord.conf\r\nRUN echo '[include]' &gt;&gt; \/etc\/supervisord.conf\r\nRUN echo 'files = supervisord.d\/*.conf' &gt;&gt; \/etc\/supervisord.conf\r\nRUN echo '[inet_http_server]' &gt;&gt; \/etc\/supervisord.conf\r\nRUN echo 'port=0.0.0.0:9001' &gt;&gt; \/etc\/supervisord.conf\r\nRUN echo 'username=takeken' &gt;&gt; \/etc\/supervisord.conf\r\nRUN echo 'password=takeken' &gt;&gt; \/etc\/supervisord.conf\r\nRUN mkdir -p \/etc\/supervisord.d\r\nADD set.conf \/etc\/supervisord.d\/set.conf\r\n\r\n#mysql\r\nRUN service mysqld restart &amp;&amp; \\\r\n\u00a0\u00a0\u00a0 \/usr\/bin\/mysqladmin -uroot password takeken\r\nRUN service mysqld restart &amp;&amp; \\\r\n\u00a0\u00a0\u00a0 mysql -uroot -ptakeken -e \"CREATE DATABASE redmine; GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'redmine'; FLUSH PRIVILEGES;\"\r\n\r\n# redmine\r\nRUN curl\u00a0 http:\/\/www.redmine.org\/releases\/redmine-2.5.0.tar.gz | tar -xz -C \/tmp\r\nRUN mv \/tmp\/redmine-2.5.0 \/var\/lib\/redmine\r\nRUN mkdir -p \/var\/lib\/redmine\/config\r\nADD configuration.yml \/var\/lib\/redmine\/config\/configuration.yml\r\nADD database.yml \/var\/lib\/redmine\/config\/database.yml\r\n\r\nRUN cd \/var\/lib\/redmine ; bundle install --without development test postgresql sqlite ;\\\r\n\u00a0\u00a0\u00a0 RAILS_ENV=production bundle exec rake db:migrate ;\\\r\n\u00a0\u00a0\u00a0 gem install passenger --no-rdoc --no-ri ;\\\r\n\u00a0\u00a0\u00a0 bundle install\r\nADD passenger.conf \/etc\/httpd\/conf.d\/passenger.conf\r\nRUN sed -ri 's_DocumentRoot.*_DocumentRoot \/var\/lib\/redmine\/public_' \/etc\/httpd\/conf\/httpd.conf\r\nRUN passenger-install-apache2-module --auto\r\nRUN service mysqld restart\r\nRUN cd \/var\/lib\/redmine ; bundle exec rake generate_session_store ; bundle exec rake generate_secret_token ; bundle install\r\nRUN sleep 60\r\nRUN \/etc\/init.d\/mysqld start &amp;&amp; cd \/var\/lib\/redmine ; bundle exec rake db:migrate RAILS_ENV=production ;\\\r\n\u00a0\u00a0\u00a0 rake tmp:cache:clear ; rake tmp:sessions:clear\r\n\r\nRUN chown -R apache:apache \/var\/lib\/redmine\r\nEXPOSE 22 80 9001\r\n\r\nCMD [\"\/usr\/bin\/supervisord\"]<\/pre>\n<p>configuration.yml<\/p>\n<pre>\u00a0$ cat docker-redmine\/conf\/configuration.yml\r\nproduction:\r\n\u00a0 email_delivery:\r\n\u00a0\u00a0\u00a0 delivery_method: :smtp\r\n\u00a0\u00a0\u00a0 smtp_settings:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 address: \"localhost\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 port: 25\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 domain: 'example.com'\r\n\r\n\u00a0 rmagick_font_path: \/usr\/share\/fonts\/ipa-pgothic\/ipagp.ttf<\/pre>\n<p>database.yml<\/p>\n<pre>$ cat docker-redmine\/conf\/database.yml\r\nproduction:\r\n\u00a0 adapter: mysql2\r\n\u00a0 database: redmine\r\n\u00a0 host: localhost\r\n\u00a0 username: redmine\r\n\u00a0 password: redmine\r\n\u00a0 encoding: utf8<\/pre>\n<p>passenger.conf\u3000\u203b\u3053\u308c\u306f\u6642\u671f\u3068\u304b\u74b0\u5883\u306b\u3088\u3063\u3066\u5909\u308f\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<pre>$ cat docker-redmine\/conf\/passenger.conf\r\nLoadModule passenger_module \/usr\/local\/lib\/ruby\/gems\/2.0.0\/gems\/passenger-4.0.48\/buildout\/apache2\/mod_passenger.so\r\n&lt;IfModule mod_passenger.c&gt;\r\n\u00a0\u00a0 PassengerRoot \/usr\/local\/lib\/ruby\/gems\/2.0.0\/gems\/passenger-4.0.48\r\n\u00a0\u00a0 PassengerDefaultRuby \/usr\/local\/bin\/ruby\r\n&lt;\/IfModule&gt;<\/pre>\n<p>set.conf<\/p>\n<pre>$ cat docker-redmine\/conf\/supervisor.conf\r\n[supervisord]\r\nnodaemon=true\r\n\r\n[program:sshd]\r\ncommand=\/usr\/sbin\/sshd -D\r\nautostart=true\r\nautorestart=true\r\n\r\n[program:httpd]\r\ncommand=\/usr\/sbin\/httpd -D FOREGROUND\r\nautostart=true\r\nautorestart=true\r\n\r\n#command ha docchika ??\r\n[program:mysqld]\r\ncommand=\/usr\/bin\/pidproxy \/var\/run\/mysqld\/mysqld.pid \/usr\/bin\/mysqld_safe --datadir=\/var\/lib\/mysql --socket=\/var\/lib\/mysql\/mysql.sock --pid-file=\/var\/run\/mysqld\/mysqld.pid --basedir=\/usr --user=mysql\r\n#command=\/usr\/bin\/mysqld_safe --datadir=\/var\/lib\/mysql --socket=\/var\/lib\/mysql\/mysql.sock --pid-file=\/var\/run\/mysqld\/mysqld.pid --basedir=\/usr --user=mysql\r\nautostart=true\r\nautorestart=true<\/pre>\n<p>\u76f8\u5909\u308f\u3089\u305a\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u9762\u306f\u3042\u307e\u308a\u8003\u616e\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u3042\u304f\u307e\u3067\u30d9\u30fc\u30b9\u3068\u3057\u3066\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u8d77\u52d5\u3057\u3066\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3053\u306e\u753b\u9762\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$ docker run -p 80:80 -p 22 -p 9001 -d take\/red \/usr\/bin\/supervisord\r\n0d82ad5a75c902d05dd9d2b59482cb40503a4214b3644e7db724e907a08f4152<\/pre>\n<p><a href=\"http:\/\/www.vincentina.net\/wp-content\/uploads\/2014\/07\/dc1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.vincentina.net\/wp-content\/uploads\/2014\/07\/dc1-300x128.jpg\" alt=\"dc1\" width=\"300\" height=\"128\" class=\"alignnone size-medium wp-image-4381\" srcset=\"https:\/\/www.vincentina.net\/wp-content\/uploads\/2014\/07\/dc1-300x128.jpg 300w, https:\/\/www.vincentina.net\/wp-content\/uploads\/2014\/07\/dc1.jpg 514w\" sizes=\"auto, (max-width: 300px) 85vw, 300px\" \/><\/a><\/p>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u306a\u306e\u3067\u3001\u30ed\u30b0\u30a4\u30f3\u30fb\u30d1\u30b9\u30ef\u30fc\u30c9\u3068\u3082\u306badmin\u3067\u3059\u3002<\/p>\n<p>\u3042\u3044\u304b\u308f\u3089\u305aruby\u306f\u77e5\u3089\u306a\u3044\u3051\u3069\u3001\u3053\u308c\u3067redmine\u3082\u304a\u624b\u8efd\u306b\u4f7f\u3048\u307e\u3059\u306d\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3058\u3083\u306d\u30fc\u3002<\/p>\n<p>&nbsp;<\/p>\n<div class='wp_social_bookmarking_light'>        <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.vincentina.net\/?p=4380\" data-text=\"redmine\u306eDockerfile\u304c\u3084\u3063\u3068\u3067\u304d\u305f\" data-via=\"TakekenTw\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u3061\u3087\u3063\u3068\u3060\u3051\u3053\u306a\u308c\u3066\u304d\u305f\u306e\u3067wordpress\u306b\u7d9a\u3044\u3066\u3001\u4eca\u5ea6\u306f\u308f\u308a\u3068\u81ea\u529b\u3067redmine\u306eDocerfile\u3092\u4f5c\u3063\u3066\u307f\u305f\u3002\u30a4\u30e1\u30fc\u30b8\u306a\u3089Docker Hub\u306b\u3042\u308b\u3093\u3060\u3051\u3069\u3001\u3084\u3063\u3071\u308a\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u76ee\u6307\u3059\u306a\u3089\u81ea\u5206\u3067\u4f5c\u3063\u3066\u307f\u305f\u3044\u3058 &hellip; <a href=\"https:\/\/www.vincentina.net\/?p=4380\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;redmine\u306eDockerfile\u304c\u3084\u3063\u3068\u3067\u304d\u305f&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-4380","post","type-post","status-publish","format-standard","hentry","category-server"],"_links":{"self":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/4380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4380"}],"version-history":[{"count":0,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/4380\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}