読者です 読者をやめる 読者になる 読者になる

DockerでRedmineを動かす

Docker Redmine

概要

自分のMac Book ProでDockerを使ってRedmineを起動させるところまでやってみた。
(とりあえずやってみた系の記事)

portの指定に注意。

手順

Docker for Macをダウンロード&インストール

f:id:maetoo11:20170220125316p:plain

起動して「Docker is running」になっていることを確認。

コンソールを開いてdockerコマンドが使えることを確認。

$ docker -v
Docker version 1.13.1, build 092cba3

Redmine用のDockerイメージがあるかを確認。

$ docker search redmine
NAME                               DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
redmine                            Redmine is a flexible project management w...   369       [OK]
sameersbn/redmine                                                                  232                  [OK]
bitnami/redmine                    Bitnami Docker Image for Redmine                14                   [OK]
74th/redmine-all-in-one            Redmine includes hosting SVN & Git , backl...   9                    [OK]
vpetersson/redmine                                                                 2                    [OK]
eeacms/redmine                     EEA Redmine docker setup                        2                    [OK]
inspiredgeek/redmine-alpine        Simple Docker images to run Redmine tracke...   2                    [OK]
commonms/redmine                   Docker image for Redmine.                       1                    [OK]
fjudith/redmine                    Dockerized Redmine based on redmine:3.3 of...   1                    [OK]
starfox/redmine-plugin-dashboard   A container designed to install redmine-da...   1                    [OK]
puffinrocks/redmine                Redmine - project management and issue tra...   0                    [OK]
zhusj/redmine                      Customized Redmine                              0                    [OK]
openfrontier/redmine               Redmine docker plus the agile plugin.           0                    [OK]
ppschweiz/redmine                                                                  0                    [OK]
liumiaocn/redmine                  redmine alpine image                            0                    [OK]
thiagorider/redmine                Redmine Docker Image Automated Build Repo.      0                    [OK]
honsiorovskyi/redmine              Official Redmine + Git + Mercurial              0                    [OK]
abcfy2/redmine                     redmine docker image forked from official ...   0                    [OK]
thooams/redmine                    Fork docker redmine                             0                    [OK]
tukiyo3/redmine                    redmine                                         0                    [OK]
mikroways/redmine                  redmine passenger image                         0                    [OK]
miko2u/redmine                     Redmine                                         0                    [OK]
enderson/redmine                   Dockerized Redmine application                  0                    [OK]
shiratamag/redmine                 openshift redmine test                          0                    [OK]
speed/redmine                      Redmine                                         0                    [OK]

今回は公式のRedmineイメージを使います。([OFFICIAL]が[OK]になっているもの)

$ docker pull redmine
Using default tag: latest
latest: Pulling from library/redmine
5040bd298390: Pull complete
596ec0bfbfe7: Pull complete
330c0f0b9895: Pull complete
759aaf3bf184: Pull complete
44da9d770a4e: Pull complete
a9b8139f979b: Pull complete
e10cd3a7c32c: Pull complete
7a316ad832a5: Pull complete
aeacba04b652: Pull complete
45ac9e0e8f38: Pull complete
5fca085ddfc6: Pull complete
969036701fdc: Pull complete
a08e120d50ea: Pull complete
d26197c612f3: Pull complete
cf0ff0b2dba2: Pull complete
Digest: sha256:e59bcba1a77fe25c84ee7d536ff6e23ded685846cfa91e4c02854d57391a52de
Status: Downloaded newer image for redmine:latest

Dockerを起動する。
※-pはローカルとDockerのポートの紐付け。これをやらないとアクセスできない。

$ docker run -p "3000:3000" redmine

warning: missing REDMINE_DB_MYSQL or REDMINE_DB_POSTGRES environment variables

*** Using sqlite3 as fallback. ***

Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Using rake 12.0.0
Using i18n 0.8.0
Using json 1.8.6
・・・(略)・・・
Using rails 4.2.7.1
Bundle complete! 32 Gemfile dependencies, 56 gems now installed.
Gems in the groups development and test were not installed.
Bundled gems are installed into /usr/local/bundle.
/usr/local/bundle/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot"
/usr/local/bundle/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot"
== 1 Setup: migrating =========================================================
-- create_table("attachments", {:force=>true})
   -> 0.0053s
-- create_table("auth_sources", {:force=>true})
・・・(略)・・・
== 20160529063352 AddRolesSettings: migrated (0.0014s) ========================

/usr/local/bundle/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot"
[2017-02-19 14:40:57] INFO  WEBrick 1.3.1
[2017-02-19 14:40:57] INFO  ruby 2.2.6 (2016-11-15) [x86_64-linux]
[2017-02-19 14:40:57] INFO  WEBrick::HTTPServer#start: pid=1 port=3000

これで localhost:3000にアクセスして、Redmineの画面が表示されればOK