• 基于 Docker 部署 Bitbucket Server
  • 基于 Docker 部署 Jira
  • 基于 Docker 部署 Confluence

Dockerizing Bitbucket Server

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

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

    1
    
    $ touch docker-compose.yml

    内容如下:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    
    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

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

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

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    
    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 参数启动,以便获取更详细的日志信息

1
  $ 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 相关数据目录
1
2
3
  $ cd /home/docker/atlassian
  $ mkdir jira-data confluence-data
  $ cd confluence-data && mkdir attachments backups && cd .. # 创建这两个文件夹 (attachments & backups) 是因为 Confluence 容器启动运行后,在配置数据库时无法通过容器内部生成(没权限),所以在宿主机上先设置好,最后通过数据卷挂载
  • 拉去相关镜像
1
2
  $ docker pull cptactionhank/atlassian-jira:7.12.2
  $ docker pull cptactionhank/atlassian-confluence:6.12.0
  • 配置 docker-compose.yml, 完整内容如下:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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:
  • 运行容器服务
1
$ 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

1
2
3
$ 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 🙂