Atlassian server products can be installed using a Docker image as well as an installer running directly on your OS.
Official docker image for Jira is published in Atlassian repository in Docker hub, so I will introduce some tips to use Atlassian server products using Docker.
The objectives of this article are
Starting up Jira, Confluence and Bitbucket on your client machine using Docker
Installing each single product
Setting up integrations between products
Note, I keep configuration as simple as possible, therefore it's not suitable for production environment. For example, some requirements like data persistence or SSL is not supported on the configuration in this article.
Also, I won't consider connecting via SSH to Bitbucket because it's not necessary for the objective of this article.
Install Docker on your machine. It may be better allocating enough memory for Docker when you boot multiple containers. I confirmed steps in this article with the following environment.
Docker Desktop 2.1.0.3 on macOS Mojave (7 GB memory allocated for Docker)
Jira 8.4.0
Confluence 7.0.1
Bitbucket 6.6.1
1. Open terminal and hit following command
docker run -d -p 8080:8080 atlassian/jira-software:latest
2. Open following URL with your browser
http://localhost:8080
1. Open terminal and hit following command
docker run -d -p 8090:8090 atlassian/confluence-server:latest
2. Open following URL with your browser
http://localhost:8090
1. Open terminal and hit following command
docker run -d -p 7990:7990 atlassian/bitbucket-server:latest
2. Open following URL with your browser
http://localhost:7990
You've done! Services run inside container by docker run command, and start listening on each port, so you can go to setup page.
In this step, proceed to evaluation setup choosing embedded database.
Above step is quite simple if you want to try using single product, but it's not sufficient if you wanted to try integrations of each products.
Because each container that is running services doesn't belong to same network and can't communicate each other.
There would be several ways to let each container communicate. Here, I'll introduce a way to boot multiple containers in a same network utilizing docker-compose.
You can try using integration functionalities by fulfilling following requirements at least.
Each service in containers can communicate each other
Name of each service is resolved by a unique URL
Note about second one. Most of Atlassian product have a configuration named "Base URL" as a unique service URL. Although you can configure multiple URLs for your instances as described in How to create an unproxied application link , it would be more straightforward if you configured as your browser and each product access using unique URLs for each services.
I will show you an example that each service is accessed via following URLs
Jira : http://jira.internal
Confluence : http://confluence.internal
Bitbucket : http://bitbucket.internal
See following diagram to figure out a network configuration.
1. First, your client computer has to allow you to access to itself looping back your requests via the above URL.
Easiest way to achieve this is just to add records in your hosts file.
127.0.0.1 jira.internal
127.0.0.1 confluence.internal
127.0.0.1 bitbucket.internal
Otherwise, you can configure local DNS using dnsmasq and letting your client computer to resolve above name as 127.0.0.1.
2. Create following two files and put them on any new directory.
docker-compose.yaml
version: '3'
services:
jira:
container_name: jira
image: atlassian/jira-software:latest
environment:
- ATL_PROXY_NAME=jira.internal
- ATL_PROXY_PORT=80
- ATL_TOMCAT_SCHEME=http
confluence:
container_name: confluence
image: atlassian/confluence-server:latest
environment:
- ATL_PROXY_NAME=confluence.internal
- ATL_PROXY_PORT=80
- ATL_TOMCAT_SCHEME=http
bitbucket:
container_name: bitbucket
image: atlassian/bitbucket-server:latest
environment:
- SERVER_PROXY_NAME=bitbucket.internal
- SERVER_PROXY_PORT=80
- SERVER_SCHEME=http
nginx:
container_name: nginx
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
depends_on:
- jira
- confluence
- bitbucket
ports:
- "80:80"
networks:
default:
aliases:
- jira.internal
- confluence.internal
- bitbucket.internal
nginx.conf
events {}
http {
server {
server_name jira.internal;
proxy_read_timeout 600s;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://jira:8080;
client_max_body_size 10M;
}
}
server {
server_name confluence.internal;
proxy_read_timeout 600s;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://confluence:8090;
client_max_body_size 10M;
}
}
server {
server_name bitbucket.internal;
proxy_read_timeout 600s;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://bitbucket:7990;
client_max_body_size 10M;
}
}
}
3. Now you are ready! Run following command and boot containers.
docker-compose up -d
4. Open "Application Link" page in Jira
Create application link for Confluence and Bitbucket.
Now you can use functionalities like Jira Issue Macro or Smart Commit
Each Docker container consumes about 2GB so some container may not boot properly if memory is not allocated enough.
You can configure memory allocation setting as https://docs.docker.com/config/containers/resource_constraints/
In this article I introduced steps to install Atlassian product with simple configuration and this won't be suitable for production environment. But you will be able to configure to work on your production environment. Please refer to the following documentations for detailed specification.
Nobuyuki Mukai
Enterprise Technical Architect
Atlassian
Japan
7 accepted answers
34 comments