26

DevOps | Dockerizing Bitbucket Server & Jira & Confluence

 2 years ago
source link: https://ijayer.github.io/post/tech/devops/cicd/20180927-cicd-04-dockerizing-bitbucketserver/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

DevOps | Dockerizing Bitbucket Server & Jira & Confluence

2018-09-27 768 words 2 mins read spinner.svg times read
  • 基于 Docker 部署 Bitbucket Server
  • 基于 Docker 部署 Jira
  • 基于 Docker 部署 Confluence

Dockerizing Bitbucket Server

  • 部署 Bitbucket Server 需要两个 Docker 镜像:Bitbucket-Server & Postgre-DB

    $ docker pull atlassian/bitbucket-server:5.10.2
    $ docker pull postgres:9.6
    • 在宿主机创建 Bitbucket Server 的数据目录
    $ mkdir -p /home/docker/atlassian && cd /home/docker/atlassian
        
    # 创建需要挂载的 Volumes 数据目录
    $ mkdir bitbucket-data postgresql-data
  • 创建 docker-compose.yml

    $ touch docker-compose.yml

    内容如下:

    version: '3'
    
    services:
      bitbucket:
        image: "atlassian/bitbucket-server:5.10.2"
        container_name: bitbucket
        restart: always
        ports:
          - "7990:7990"
          - "7999:7999"
        environment:
          - BITBUCKET_HOME=/var/atlassian/application-data/bitbucket/
        volumes:
          - ./bitbucket-data:/var/atlassian/application-data/bitbucket
        
      db:
        image: postgres:9.6
        container_name: postgresql
        restart: always
        ports:
          - "5432:5432"
        environment:
          POSTGRES_PASSWORD: <your_pwd>
          POSTGRES_USER: <your_user>
          POSTGRES_DB: postgres
          PGDATA: /var/lib/postgresql/data/pgdata
        volumes:
          - ./postgresql-data:/var/lib/postgresql/data
    
    volumes:
      bitbucket-data:
      postgresql-data:

    Note:

    • 上面 docker-compose.yml 中,Data Volumes 是创建在 Compose 内部的。如果要挂载已创建好的数据卷可以设置 external 选项。
    • 这里测试时未启用:external。 如需启用,配置方法在下一步
  • (Optional) 挂载已创建好的数据卷(named volumes), 使用 docker volume create --name <volume_name> 创建

    Note: 关于数据卷的更多信息可以查看官方文档:Use volumes

    $ docker volume create --name bitbucket-data
    $ docker volume create --name postgresql-data

    修改 docker-compose.yml 配置,完整内容如下:

    version: '3'
    
    services:
      bitbucket:
        image: "atlassian/bitbucket-server:5.10.2"
        container_name: bitbucket
        restart: always
        ports:
          - "7990:7990"
          - "7999:7999"
        environment:
          - BITBUCKET_HOME=/var/atlassian/application-data/bitbucket/
        volumes:
          - ./bitbucket-data:/var/atlassian/application-data/bitbucket
        
      db:
        image: postgres:9.6
        container_name: postgresql
        restart: always
        ports:
          - "5432:5432"
        environment:
          POSTGRES_PASSWORD: <your_pwd>
          POSTGRES_USER: <your_user>
          POSTGRES_DB: postgres
          PGDATA: /var/lib/postgresql/data/pgdata
        volumes:
          - ./postgresql-data:/var/lib/postgresql/data
    
    volumes:
      bitbucket-data:
        external:
          name: bitbucket-data
      postgresql-data:
        external:
          name: postgresql-data
  • 运行容器服务

Note: 让应用容器在前台运行,并加入 –verbose 参数启动,以便获取更详细的日志信息

  $ docker-compose --verbose up 

访问:http://localhost:7990

Config Bitbucket Server

  • 默认选项,进入下一步 -> Licensing and settings

    • 填写表单数据
    • License Key 选择:I need an envaluation license, 然后登陆 Google 账号,生成 Key 填入;进入下一步
  • 配置管理员账号,登陆即可

Dockerizing Jira and Confluence [20181012 Updated]

  • 创建 Jira & Confluence 相关数据目录
  $ cd /home/docker/atlassian
  $ mkdir jira-data confluence-data
  $ cd confluence-data && mkdir attachments backups && cd .. # 创建这两个文件夹 (attachments & backups) 是因为 Confluence 容器启动运行后,在配置数据库时无法通过容器内部生成(没权限),所以在宿主机上先设置好,最后通过数据卷挂载
  • 拉去相关镜像
  $ docker pull cptactionhank/atlassian-jira:7.12.2
  $ docker pull cptactionhank/atlassian-confluence:6.12.0
  • 配置 docker-compose.yml, 完整内容如下:
version: '3'

services:
    
  bitbucket:
    image: "atlassian/bitbucket-server:5.10.2"
    container_name: bitbucket
    restart: always
    ports:
      - "7990:7990"
      - "7999:7999"
    environment:
      - BITBUCKET_HOME=/var/atlassian/application-data/bitbucket/
    volumes:
      - ./bitbucket-data:/var/atlassian/application-data/bitbucket

  jira:
    image: cptactionhank/atlassian-jira:7.12.2
    container_name: jira
    restart: always
    ports:
      - "6080:8080"
    links:
      - database
    volumes:
      - ./jira-data:/var/atlassian/application-data/jira

  confluence:
    image: cptactionhank/atlassian-confluence:6.12.0
    container_name: confluence
    restart: always
    ports:
      - "8090:8090"    
    links:
      - database
    volumes:
      - ./confluence-data:/var/atlassian/application-data/confluence

  database:
    image: postgres:9.6
    container_name: postgresql
    restart: always
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: <input_user>
      POSTGRES_PASSWORD: <input_pwd>
      POSTGRES_DB: postgres
      PGDATA: /var/lib/postgresql/data/pgdata
    volumes:
      - ./postgresql-data:/var/lib/postgresql/data

volumes:
  bitbucket-data:
  jira-data:
  confluence-data:  
  postgresql-data:
  • 运行容器服务
$ docker-compose up -d

Crack [20181219 Updated]

Crack Bitbucket Server

Step1: Download Bitbucket Server Crack Jar files

  • atlassian-extras-decoder-v2-3.3.0.jar
  • atlassian-extras-legacy-3.3.0.jar

Step2: Copy crack jar files to docker server

$ docker cp atlassian-extras-decoder-v2-3.3.0.jar <container_name(id)_of_bitbucket_server>:/opt/atlassian/bitbucket/app/WEB-INF/lib
$ docker cp atlassian-extras-legacy-3.3.0.jar <container_name(id)_of_bitbucket_server>:/opt/atlassian/bitbucket/app/WEB-INF/lib
$ docker restart <container_name(id)_of_bitbucket_server>

Finally, the result looks like this:

See Also

Thanks to the authors 🙂

Author zher

LastMod 2018-12-19

License CC BY-NC-ND 4.0

DevOps | Add an OAuth consumer(Application Links) to Bitbucket Server DevOps | CI/CD 实践: Drone + Docker + Bitbucket Server 服务部署
5 comments
@sahibzadafahad99
sahibzadafahad99commentedover 3 years ago

how we will crack jira and confluence with above mentioned bitbucket server crack jar file ?

@ijayer
ijayercommentedover 3 years ago

@sahibzadafahad99
how we will crack jira and confluence with above mentioned bitbucket server crack jar file ?

This crack file is only for cracking the bitbucket server. I have not tested for Cracking Jira and Confluence. Maybe you can try jira7.2_crack.7z for cracking Jira and ref to here for cracking Confluence.

The cracking steps I have updated in the article. You can check it out.

@sahibzadafahad99
sahibzadafahad99commentedover 3 years ago

Thank you it's working :)

@chendeshen
chendeshencommentedover 3 years ago
@yamazakei321
yamazakei321commented11 months ago

work well on bitbucket 6-7.12.0 but not work on bitbucket 7.13.0 ,need update.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK