Docker部署Jira&Confluence

Docker部署Jira&Confluence

  • Uninstall docker
  • Install yum tools
  • Add repo to profile
  • Install docker
  • Start docker
  • Install docker-compose
  • Change docker download source
  • Biuld MySQL
  • Biuld JIRA&Confluence
  • Confluence
  • Install Nginx
  • Codpy file to container

Uninstall docker

sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

Install yum tools

sudo yum install -y yum-utils

Add repo to profile

sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

Install docker

sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Start docker

sudo systemctl start docker

Install docker-compose

wget https://share.mrbun.cn/seafhttp/files/336faefc-5ce3-4456-809b-431180e5f4ea/docker-compose

mv docker-compose /usr/local/bin

sudo chmod +x /usr/local/bin/docker-compose

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

docker-compose version

Change docker download source

sudo vi /etc/docker/daemon.json
{
    "registry-mirrors": [
        "http://hub-mirror.c.163.com",
        "https://docker.mirrors.ustc.edu.cn",
        "https://registry.docker-cn.com"
    ]
}
sudo systemctl daemon-reload

sudo systemctl restart docker

Biuld MySQL

docker pull mysql:5.7.24

docker run --name mysql.5.7 --restart always -p 33060:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql:5.7.24

docker exec -it mysql.5.7 /bin/bash

mysql -uroot -p

root

CREATE DATABASE jira CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

CREATE user 'jira'@'%' IDENTIFIED BY '';

GRANT ALL PRIVILEGES ON jira.* TO 'jira'@'%' WITH GRANT OPTION;

CREATE DATABASE confluence CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

CREATE user 'confluence'@'%' IDENTIFIED BY '';

GRANT ALL PRIVILEGES ON confluence.* TO 'confluence'@'%' WITH GRANT OPTION;

Biuld JIRA&Confluence

mkdir -p /home/data/{jira,confluence}

cd /home/data/jira/

vim Dockerfile
FROM cptactionhank/atlassian-jira-software:8.1.0
 
USER root
 
# 将代理破解包加入容器
COPY "atlassian-agent.jar" /opt/atlassian/jira/
 
# 设置启动加载代理包
RUN echo 'export CATALINA_OPTS="-javaagent:/opt/atlassian/jira/atlassian-agent.jar ${CATALINA_OPTS}"' >> /opt/atlassian/jira/bin/setenv.sh
wget https://share.mrbun.cn/seafhttp/files/78b034ec-cde4-4e64-93f3-aade969e6e3c/atlassian-agent.jar

docker build -t jira:8.1.0 .

docker run -d --name jira  --restart always -p 18009:8080   -e TZ="Asia/Shanghai"   -m 4096M   -v /home/data/jira:/var/atlassian/jira jira:8.1.0

docker exec -it jira /bin/bash

cd /opt/atlassian/jira/

java -jar atlassian-agent.jar -d -m [email protected] -n BAT -p jira -o http://{IP} -s 刚上面截图的服务器ID

Confluence

cd /home/data/confluence

vim Dockerfile
FROM cptactionhank/atlassian-confluence:7.9.3

USER root

# 将代理破解包加入容器
COPY "atlassian-agent.jar" /opt/atlassian/confluence/
#
# # 设置启动加载代理包
RUN echo 'export CATALINA_OPTS="-javaagent:/opt/atlassian/confluence/atlassian-agent.jar ${CATALINA_OPTS}"' >> /opt/atlassian/confluence/bin/setenv.sh
wget https://share.mrbun.cn/seafhttp/files/78b034ec-cde4-4e64-93f3-aade969e6e3c/atlassian-agent.jar

docker build -t atlassian-confluence:7.9.3 .

docker run -d --name confluence --restart always -p 18010:8090 -e TZ="Asia/Shanghai" -m 2048M -v /home/data/confluence/:/var/atlassian/confluence atlassian-confluence:7.9.3

docker exec -it confluence /bin/bash

java -jar atlassian-agent.jar -d -m [email protected] -n BAT -p conf -o http://{IP} -s 服务器ID

jdbc:mysql://192.168.31.19:33060/confluence?useUnicode=true&characterEncoding=utf8

Install Nginx

sudo yum install -y epel-release

sudo yum install -y nginx

Codpy file to container

#这里的server.xml请参考[这里](https://www.yudelei.com/index.php/327.html)
#我实在本地修改好了之后手动打到容器内
#之后重启Nginx,jira,confluence的容器
docker cp server.xml c3def5acdce2:/opt/atlassian/confluence/conf
docker cp server.xml c3def5acdce2:/opt/atlassian/jira/conf

你可能感兴趣的:(Docker,JIRA,Confluence,docker,jira,运维)