LoginSignup
1
4

More than 5 years have passed since last update.

IBM Bluemix 上でRedmineを動かすまで (その1)

Last updated at Posted at 2016-08-23

どうやらBluemixのDockerサービスを使うには、IBMのレポジトリにimageを登録しておく必要があるようです。そのためには、Dockerだけじゃなくて、cloud foundryをインストールしておく必要があるらしい???

よく分かっていないのですが、取り合えずBluemixのマニュアルに書いてある通りに進めてみます。といいながらcf-cliのインストールの時点でずっこけるわけですが。

まずはCloud Foundry CLI をローカル側にインストール

事前にDockerimageを作って、cloud foundryでIBMのレポジトリに登録しないといけないらしい。まずcf-cliをUbuntuにインストールするところで苦労。apt-getとか昔はできたらしいけど、今はバイナリをダウンロードするのが一番早いぽい。

$ wget "https://cli.run.pivotal.io/stable?release=linux64-binary&version=6.21.1&source=github-rel" -O - | tar zxvf - 
$ chmod 755 cf-cli_linux_x86-64 

※ きちんとPATH通ったところにインストールした偉い方は、以後 ./cf-cli_linux_x86-64cf に読み替えてください。
そしてIBM Bluemix用のプラグインをインストール

$ ./cf-cli_linux_x86-64 install-plugin https://static-ice.ng.bluemix.net/ibm-containers-linux_x64

ログイン

$ ./cf-cli_linux_x86-64 login

API endpoint> https://api.ng.bluemix.net

Email> email@example.com

Password> 
Authenticating...
OK

$ ./cf-cli_linux_x86-64 ic init
Deleting the old configuration file...
Generating client certificates for IBM Containers...
Storing client certificates in /home/fabric/.ice/certs/...

Storing client certificates in /home/fabric/.ice/certs/containers-api.ng.bluemix.net/(省略)...

OK
The client certificates were retrieved.

Checking local Docker configuration...
OK

Authenticating with the IBM Containers registry host registry.ng.bluemix.net...
OK
You are authenticated with the IBM Containers registry.
Your organization's private Bluemix repository: registry.ng.bluemix.net/aaaaaaa

You can choose from two ways to use the Docker CLI with IBM Containers:


Option 1: This option allows you to use 'cf ic' for managing containers on IBM Containers while still using the Docker CLI directly to manage your local Docker host.
        Use this Cloud Foundry IBM Containers plug-in without affecting the local Docker environment:


        Example Usage:
        cf ic ps
        cf ic images

Option 2: Use the Docker CLI directly. In this shell, override the local Docker environment by setting these variables to connect to IBM Containers. Copy and paste the following commands:
        Note: Only some Docker commands are supported with this option. Run cf ic help to see which commands are supported. 
        export DOCKER_HOST=tcp://containers-api.ng.bluemix.net:8443
        export DOCKER_CERT_PATH=(省略)
        export DOCKER_TLS_VERIFY=1

        Example Usage:
        docker ps
        docker images

dockerイメージを取得して、IBMのレポジトリへコピー

$ docker pull redmine
$ docker tag redmine registry.ng.bluemix.net/aaaaaaa/my_redmine
$ docker push registry.ng.bluemix.net/aaaaaaa/my_redmine
The push refers to a repository [registry.ng.bluemix.net/aaaaaaa/my_redmine]
1c6430073bcb: Pushed 
a8a082de227c: Pushed 
f6718fe02a5d: Pushed 
08fe404c6e4a: Pushed 
8c5b544c33d3: Pushed 
022c5805ed20: Pushed 
377713e68b35: Pushed 
a1e7408a8615: Pushed 
61d43a231619: Pushed 
85ec18374376: Pushed 
853ab7803cf6: Pushed 
825bd1cf911a: Pushed 
79812a227e08: Pushed 
2f71b45e4e25: Pushed 
latest: digest: sha256:00739892602f11f6a7a41b9adfaac2152d32d89018f16f715da8d462ed94b01c size: 22261

この時点で、コンソールのイメージ一覧に表示されているので、そこから起動したほうがいろんな設定ができます。パブリックIPとか。
64MBの最小構成でも十分動きます。

スクリーンショット 2016-08-23 9.43.01 PM.png

一応コマンドラインでの起動方法。

$ ./cf-cli_linux_x86-64 ic run --name my_redmine registry.ng.bluemix.net/aaaaaaa/my_redmine

あとは、ポート3000にアクセスすればredmineのログイン画面にいきます。
初期パスワードは ID:admin PW:adminです。
当たり前ですがhttpなので大事な情報をやりとりしないようにしましょう。

後日談

PostgresとHTTPS化をしました。
IBM Bluemix 上でRedmineを動かすまで (その2)

1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4