0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

docker-composeでJiraとConfluenceを立てる

Last updated at Posted at 2019-10-28

概要

  • JiraとConfluenceを自前サーバで立てる
  • Install & 環境構築を楽する為にdocker-composeを使う

環境

  • 自前サーバは何でも良いが、とりあえず今回はMacOS上のVirtualBox/Vagrantで用意
  • VMのOSはUbuntu18.04を使用(dockerのinstall部分は、CentOSの場合、手順が異なるので注意)

手順

Vagrantfileを作成する

bash
# vagrantfileを置くdirectoryを作成
iguchi@igc-mbp:~$ mkdir -p my-vagrant/jira-confluence-study

# vagrantfileを生成
iguchi@igc-mbp:~/my-vagrant/jira-confluence-study$ vagrant init bento/ubuntu-18.04

VMのNetworkとMemoryを設定する(Vagrantfileに書く)

bash
iguchi@igc-mbp:~/my-vagrant/jira-confluence-study$ vi Vagrantfile
...(omit)...
# 以下をコメントイン。IP addressは適宜変える。今回はdefaultのまま
  config.vm.network "private_network", ip: "192.168.33.10"
...(omit)...
# 以下のあたりをコメントイン。Vagrantfileでvmに割当てるmemory sizeを増やしておく
# 理由:jiraとconfluenceを一つのVM内で動かすにはdefaultの1024はmemory不足
  config.vm.provider "virtualbox" do |vb|
    # Display the VirtualBox GUI when booting the machine
    # vb.gui = true

    # Customize the amount of memory on the VM:
    vb.memory = "2048"
  end
...(omit)...

VMを起動する

bash
iguchi@igc-mbp:~/my-vagrant/jira-confluence-study$ vagrant up

起動したVMにssh接続する

bash
iguchi@igc-mbp:~/my-vagrant/jira-confluence-study$ vagrant ssh

VMにDockerをinstallする

bash

vagrant@vagrant:~$ sudo apt update
vagrant@vagrant:~$ sudo apt-get remove docker docker-engine docker.io containerd runc
vagrant@vagrant:~$ sudo apt update
vagrant@vagrant:~$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
vagrant@vagrant:~$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
vagrant@vagrant:~$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
vagrant@vagrant:~$ sudo apt update
vagrant@vagrant:~$ sudo apt-get install docker-ce docker-ce-cli containerd.io
vagrant@vagrant:~$ sudo groupadd docker
groupadd: group 'docker' already exists
vagrant@vagrant:~$ sudo usermod -aG docker $USER
vagrant@vagrant:~$ newgrp docker

docker-composeをinstallする

bash
vagrant@vagrant:~/jira$ sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
vagrant@vagrant:~/jira$ sudo chmod +x /usr/local/bin/docker-compose

docker-composeを使ってJIRAをinstallする

適当なディレクトリを作成し、永続データを保存するフォルダを作成

bash
vagrant@vagrant:~$ mkdir jira && cd jira && mkdir jiraVolume

docker-compose.ymlを作成

bash
vagrant@vagrant:~/jira$ cat docker-compose.yml
version: '3'
services:
  jira:
    image: atlassian/jira-software
    ports:
      - "8080:8080"
    volumes:
      - ./jiraVolume:/var/atlassian/application-data/jira
vagrant@vagrant:~/jira$

作業後の状態

bash
vagrant@vagrant:~/jira$ tree
.
├── docker-compose.yml
└── jiraVolume
vagrant@vagrant:~/jira$

docker-comopseでjiraのコンテナを起動

bash
vagrant@vagrant:~/jira$ docker-compose up -d

httpでJiraにアクセスし、GUIの指示に従って設定

docker-composeを使ってConfluenceをinstallする

適当なディレクトリを作成し、永続データを保存するフォルダを作成

bash
vagrant@vagrant:~$ mkdir confluence && cd confluence && mkdir confluenceVolume

docker-compose.ymlを作成

bash
vagrant@vagrant:~/confluence$ cat docker-compose.yml
version: '3'
services:
  confluence:
    image: atlassian/confluence-server
    ports:
      - "8090:8090"
      - "8091:8091"
    volumes:
      - ./confluenceVolume:/var/atlassian/application-data/confluence
vagrant@vagrant:~/confluence$

docker-comopseでconfluenceのコンテナを起動

bash
vagrant@vagrant:~/confluence$ docker-compose up -d

httpでConfluenceにアクセスし、GUIの指示に従って設定

0
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
0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?