Atlassian Jira Docker for Apple M1 processors

I got a new mac device with Apple M1 processor and decided to put up an Atlassian Jira docker container.

Official Atlassian docker image does not work for M1 processors. There is a ticket in Atlassian Support to provide a docker image for M1 but it is not resolved on the date of writing this article.

That is why I searched in the internet and found a docker image over here. You can also find a docker-compose.ym file for it which looks something like this:

version: '3'

services:
  jira:
    depends_on:
      - postgresql
    image: dchevell/jira-software-arm64
    networks:
      - jiranet
    volumes:
      - jiradata:/var/atlassian/jira
    ports:
      - '8080:8080'
    environment:
      - 'JIRA_DATABASE_URL=postgresql://jira@postgresql/jiradb'
      - 'JIRA_DB_PASSWORD=Postgres_passwords'
      - 'SETENV_JVM_MINIMUM_MEMORY=2048m'
      - 'SETENV_JVM_MAXIMUM_MEMORY=4096m'
      - 'JIRA_PROXY_NAME='
      - 'JIRA_PROXY_PORT='
      - 'JIRA_PROXY_SCHEME='
    logging:
      # limit logs retained on host to 25MB
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"

  postgresql:
    image: postgres:9.5-alpine
    networks:
      - jiranet
    volumes:
      - postgresqldata:/var/lib/postgresql/data
    environment:
      - 'POSTGRES_USER=jira'
      # CHANGE THE PASSWORD!
      - 'POSTGRES_PASSWORD=Postgres_password'
      - 'POSTGRES_DB=jiradb'
      - 'POSTGRES_ENCODING=UNICODE'
      - 'POSTGRES_COLLATE=C'
      - 'POSTGRES_COLLATE_TYPE=C'
    logging:
      # limit logs retained on host to 25MB
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"

volumes:
  jiradata:
    external: false
  postgresqldata:
    external: false

networks:
  jiranet:
    driver: bridge

You can start this docker-compose.yml file but it will not work (at least for me it did not work). After you select your database you will have an error that the config file can not be changed because there is not enough permissions. I entered to the docker container and changed permissions for Jira folder and everything started to work.

Then I noticed that the version of Jira Software in the image is 8.5.1 and I need to update it to the current version.

And here I decided to stop my activities to look for ready solutions and make my own

My Solution

This solution is not meant to work in production. I created this docker image only for development purpose. I do not use this docker image in production.

Ok. Let’s start.

First, create Dockerfile

FROM ubuntu:latest
WORKDIR /home
RUN apt update
RUN apt --assume-yes install openjdk-11-jdk curl
RUN mkdir -p downloads
RUN cd downloads
RUN mkdir -p jirahome
RUN curl https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-9.2.0.tar.gz --output atlassian-jira-software-9.2.0.tar.gz
RUN tar -xvf atlassian-jira-software-9.2.0.tar.gz
ENV JIRA_HOME=/home/downloads/jirahome
CMD ["atlassian-jira-software-9.2.0-standalone/bin/start-jira.sh", "-fg"]

This Dockerfile gets the latest version of Ununtu for arm64. Installs Java 11, downloads an archive with Jira Software distribution, unpacks the archive and then runs Jira Software.

Currently I download Jira Software version 9.2.0. But you can change 9.2.0 for the version you want in the Docker file and you will get the version you want.

After it you need to create an image from the Dockerfile. You need to run the following commands:

docker build -t jira-software-arm64:9.2.0 .

And then you can run the docker container for this image and have Jira Software:

docker run -p 8080:8080 -it jira-software-arm64:9.2.0

Create docker-compose.yml

Now we can change the docker-compose.yml file which I pasted in the beginning of the article to use our image:

version: '3'

services:
  jira:
    depends_on:
      - postgresql
    image: jira-software-arm64:9.2.0
    networks:
      - jiranet
    volumes:
      - jiradata:/var/atlassian/jira
    ports:
      - '8080:8080'
    logging:
      # limit logs retained on host to 25MB
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"

  postgresql:
    image: postgres:9.5-alpine
    networks:
      - jiranet
    volumes:
      - postgresqldata:/var/lib/postgresql/data
    environment:
      - 'POSTGRES_USER=jira'
      # CHANGE THE PASSWORD!
      - 'POSTGRES_PASSWORD=Postgres_password'
      - 'POSTGRES_DB=jiradb'
      - 'POSTGRES_ENCODING=UNICODE'
      - 'POSTGRES_COLLATE=C'
      - 'POSTGRES_COLLATE_TYPE=C'
    logging:
      # limit logs retained on host to 25MB
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"

volumes:
  jiradata:
    external: false
  postgresqldata:
    external: false

networks:
  jiranet:
    driver: bridge

Now run the docker-compose.yml file with docker-compose up and you will have Jira Software running on 8080.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: