Jira in Docker on Apple Silicone (M1) - docker

I'm recently trying to get a local Jira instance run in a docker container on an Apple Silicone M1 chip.
I'm using Postgres for the database (also tried mariaDB) and an arm image of Jira that I've found on GitHub.
However, whenever I docker-compose the setup I run into an error 500 "Error writing database configuration file."
Both, Jira and the DB container seem to start up fine.
I guess that the database might be not reachable but I have no idea how to check that.
TLDR: How can I check whether my DB is reachable to my Jira container OR rather how to fix the error 500 from Jira "Error writing database configuration file."
Below is the compose file I'm using:
services:
jira:
dchevell/jira-software-arm64
#image: ghcr.io/eugenmayer/jira:${JIRA_VERSION}
depends_on:
- db
container_name: jirasoftwarevomeugen
volumes:
- jiradata:/var/atlassian/jira
ports:
- '80:8080'
environment:
- 'JIRA_DATABASE_URL=postgresql://jira#db/jiradb'
- 'JIRA_DB_PASSWORD=jellyfish'
- 'CATALINA_OPTS= -Xms256m -Xmx1g'
- 'JIRA_PROXY_NAME='
- 'JIRA_PROXY_PORT='
- 'JIRA_PROXY_SCHEME='
# need for the wait-for-db statement
- 'JIRA_DB_HOST=db'
- 'JIRA_DB_PORT=5432'
db:
image: postgres
hostname: postgresql
volumes:
- postgresqldata:/var/lib/postgresql/data
environment:
- 'POSTGRES_USER=jira'
- 'POSTGRES_PASSWORD=jellyfish'
- 'POSTGRES_DB=jiradb'
- 'POSTGRES_ENCODING=UTF8'
- 'POSTGRES_COLLATE=C'
- 'POSTGRES_COLLATE_TYPE=C'
# uncomment this to run against mysql
# db:
# image: mariadb:10.3
# hostname: mysql
# volumes:
# - mysqldata:/var/lib/mysql
# environment:
# - 'MYSQL_ROOT_PASSWORD=verybigsecretrootpassword'
# - 'MYSQL_DATABASE=jiradb'
# - 'MYSQL_USER=jira'
# - 'MYSQL_PASSWORD=jellyfish'
volumes:
jiradata:
external: false
postgresqldata:
external: false
mysqldata:
external: false
newdb:
external: false

When Jira starts up, it will try to write configuration files into the Jira data directory. This type of problem can occur if the directory you have mounted is not writable by the Jira user.
You may want to investigate the UID:GID of the Jira user in the image you have chosen, then spin up a standalone container to run a shell (which also mounts the jiradata container), chown -R the mounted directory to the correct user:group (if it is not what you expect), and then try restarting Jira.

I took a build in arm architecture and uploaded it to the hub. You can access it here. You can use the following docker compose as an example.
version: "3.1"
volumes:
jira_volume:
postgres_volume:
services:
postgres:
image: postgres:10
ports:
- 5435:5432
volumes:
- postgres_volume:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: admin
jira:
image: yasinmert/atlassian-jira-software-arm64
ports:
- 7030:8080
volumes:
- jira_volume:/var/atlassian/application-data/jira
environment:
ATL_TOMCAT_CONTEXTPATH: /jira
ATL_JDBC_URL: jdbc:postgresql://postgres:5432/jira
ATL_JDBC_USER: postgres
ATL_JDBC_PASSWORD: admin
ATL_DB_DRIVER: org.postgresql.Driver
depends_on:
- postgres

Related

Docker container does not sync volumes

I have created a container with docker-compose, it runs without a problem, the database is connected right but the volumes are not in sync between the container and local folder. I started it with the following code:
version: "3"
services:
web:
image: "prestashop/prestashop:1.7"
ports:
- "8080:80"
environment:
- PS_DEV_MODE=1
- XDEBUG_CONFIG
- PS_INSTALL_AUTO=1
- PS_FOLDER_INSTALL=installDirHasToBeRenamed
- PS_FOLDER_ADMIN=admin1234
- ADMIN_MAIL=admin#shop.com
- ADMIN_PASSWD=admin1234
- DB_SERVER=database
- DB_NAME=prestashop
- DB_USER=root
- DB_PASSWD=admin
- PS_INSTALL_DB=1
- PS_ERASE_DB=1
networks:
- network
volumes:
- .:/var/www/html/modules/mymoduledir
# Do not forget to remove directory when removing containers with `docker-compose rm`
- .docker/web:/var/www/html
database:
# MySQL 5.7 is recommended for the Docker version
# https://hub.docker.com/r/prestashop/prestashop/
image: "mysql:5.7"
ports:
- "3307:3306"
environment:
- MYSQL_ROOT_PASSWORD=admin
networks:
- network
networks:
network:
This is a prestashop 1.7 module, the given directory is the one where it will be installed, so I tried the following things to make this work:
I used chmod on the container's side so it can be used but it did not worked, prestashop still wasn't able to use that folder
from a fresh start I deleted the folder, this way it was possible to install the module but the local changes wasn't showed up in the container.
please replace . by $(pwd) not that for your database you don't have volumes mounted.
volumes:
- $(pwd):/var/www/html/modules/mymoduledir
best practice would be in any case :
rootfolder
|-Docker-compose.yaml
|-web/
|-directory_to_mount
|-postgres/
|-directory_to_mount

understanding Docker compose mongodb and rails application

there is ruby on rails application which uses mongodb and postgresql databases. When I run it locally everything works fine, however when I try to open in a remote container, it throws error message
2021-03-14T20:22:27.985+0000 Failed: error connecting to db server: no reachable servers
the docker-compose.yml file defines following services:
redis mongodb db rails
I start remote containers with following command:
docker-compose build - build successful
docker-compose up -d - containers are up and running
when I connect to the rails container and try to do
bundle exec rake aws:restore_db
error mentioned above is thrown. I don't know what is wrong here. The mongodb container is up and running.
the docker-compose.yml is mentioned below:
version: '3.4'
services:
redis:
image: redis:5.0.5
mongodb:
image: mongo:3.6.13
volumes:
- mongo-data:/data/db
db:
image: postgres:11.3
volumes:
- db-data:/var/lib/postgresql/data
rails:
build: .
image: proj:latest
depends_on:
- db
- mongodb
- redis
volumes:
- .:/proj
ports:
- "3000:3000"
tty: true
stdin_open: true
env_file:
- .env/development.env
volumes:
db-data:
mongo-data:
this is how I start all four remote containers:
$ docker-compose up -d
Starting proj_db_1 ... done
Starting proj_redis_1 ... done
Starting proj_mongodb_1 ... done
Starting proj_rails_1 ... done
please help me to understand how remote containers should interact with each other.
Your configuration should point to the services by name and not to a port on localhost. For example, if you ware connecting to redis as localhost:6380 or 127.0.0.1:6380, now you need to use redis:6380
If this is still not helping, you can try to add links between containers in order the names given to them as services to be resolved. So the file will look something like this:
version: '3.4'
services:
redis:
image: redis:5.0.5
networks:
- front-end
links:
- "mongodb:mongodb"
- "db:db"
- "rails:rails"
mongodb:
image: mongo:3.6.13
volumes:
- mongo-data:/data/db
networks:
- front-end
links:
- "redis:redis"
- "db:db"
- "rails:rails"
db:
image: postgres:11.3
volumes:
- db-data:/var/lib/postgresql/data
networks:
- front-end
links:
- "redis:redis"
- "mongodb:mongodb"
- "rails:rails"
rails:
build: .
image: proj:latest
depends_on:
- db
- mongodb
- redis
volumes:
- .:/proj
ports:
- "3000:3000"
tty: true
stdin_open: true
env_file:
- .env/development.env
networks:
- front-end
links:
- "redis:redis"
- "mongodb:mongodb"
- "db:db"
volumes:
db-data:
mongo-data:
networks:
front-end:
The links will allow for a hostnames to be defined in the containers.
The link flag is legacy, and in new versions of docker-engine it's not required for user defined networks. Also, the links will be ignored in case of docker swarm deployment. However since there are sill old installations of Docker and docker-compose, this is one thing to try in troubleshooting.

How to access wacore container which is exiting due to file error present within - "/opt/whatsapp/bin/wait_on_postgres.sh"

I am launching containers via docker-compose, but 2 out of 3 containers are failing stating -:"exec user process caused "exec format error" "
The above error is caused while executing a file places at location /opt/whatsapp/bin/wait_on_postgres.sh, i need to add #!/bin/bash at top of this file.
Problem is, the container is exiting in no time so how to access this file to make necessary changes ??
Below is the docker-compose.yml i am using -:
version: '3'
volumes:
whatsappMedia:
driver: local
postgresData:
driver: local
services:
db:
image: postgres:10.6
command: "-p 3306 -N 500"
restart: always
environment:
POSTGRES_PASSWORD: testpass
POSTGRES_USER: root
expose:
- "33060"
ports:
- "33060:3306"
volumes:
- postgresData:/var/lib/postgresql/data
network_mode: bridge
wacore:
image: docker.whatsapp.biz/coreapp:v${WA_API_VERSION:?Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.31.4 docker-compose <command> <options>)}
command: ["/opt/whatsapp/bin/wait_on_postgres.sh", "/opt/whatsapp/bin/launch_within_docker.sh"]
volumes:
- whatsappMedia:/usr/local/wamedia
env_file:
- db.env
environment:
# This is the version of the docker templates being used to run WhatsApp Business API
WA_RUNNING_ENV_VERSION: v2.2.3
ORCHESTRATION: DOCKER-COMPOSE
depends_on:
- "db"
network_mode: bridge
links:
- db
waweb:
image: docker.whatsapp.biz/web:v${WA_API_VERSION:?Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.31.4 docker-compose <command> <options>)}
command: ["/opt/whatsapp/bin/wait_on_postgres.sh", "/opt/whatsapp/bin/launch_within_docker.sh"]
ports:
- "9090:443"
volumes:
- whatsappMedia:/usr/local/wamedia
env_file:
- db.env
environment:
WACORE_HOSTNAME: wacore
# This is the version of the docker templates being used to run WhatsApp Business API
WA_RUNNING_ENV_VERSION: v2.2.3
ORCHESTRATION: DOCKER-COMPOSE
depends_on:
- "db"
- "wacore"
links:
- db
- wacore
network_mode: bridge
Problem got resolved by using 64bit guest OS image.
I was running this container over 32 bit Centos which was causing the error.

PhpStorm Docker remote PHP interpreter stops responding with message "Checking PHP Installation"

I'm trying to setup development environment using PhpStorm, Docker on Windows 10 machine.
When remote PHP interpreter selected PhpStorm stops responding with message "Checking PHP Installation":
docker-compose.yaml
version: '3'
networks:
symfony:
services:
#nginx
nginx-ea:
image: nginx:stable-alpine
container_name: nginx-ea
ports:
- "8081:80"
volumes:
- ./app:/var/www/project
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- php74-fpm
- mysql8-ea
networks:
- symfony
# php74
php74-fpm:
build:
context: .
dockerfile: ./php/Dockerfile
container_name: php74-fpm
ports:
- "9001:9000"
volumes:
- ./app:/var/www/project
- ./php/conf:/usr/local/etc/php/
networks:
- symfony
php74-cli:
# define the directory where the build should happened,
# i.e. where the Dockerfile of the service is located
# all paths are relative to the location of docker-compose.yml
build:
context: ./php-cli
container_name: php74-cli
# reserve a tty - otherwise the container shuts down immediately
# corresponds to the "-i" flag
tty: true
# mount the app directory of the host to /var/www in the container
# corresponds to the "-v" option
volumes:
- ./app:/var/www/project
# connect to the network
# corresponds to the "--network" option
networks:
- symfony
# mysql 8
mysql8-ea:
image: mysql:8
container_name: mysql8-ea
ports:
- "4309:3306"
volumes:
- ./mysql:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always # always restart unless stopped manually
environment:
MYSQL_USER: root
MYSQL_ROOT_PASSWORD: secret
MYSQL_PASSWORD: secret
networks:
- symfony
#PhpMyAdmin
phpmyadmin-ea:
image: phpmyadmin/phpmyadmin:5.0.1
container_name: phpmyadmin-ea
restart: always
environment:
PMA_HOST: mysql8-ea
PMA_USER: root
PMA_PASSWORD: secret
ports:
- "8090:80"
networks:
- symfony
Docker Desktop Windows 10 settings
Have tried selecting both php74-fpm container and php74-cli container, as soon as settings applied in PhpStorm it stops responding completely.
Any idea what is wrong in here?
UPDATE
Including PHPStorm logs from system\log\idea.log
# appears in logs when Remote PHP Interpreter settings applied
2020-11-27 09:14:00,859 [ 479670] DEBUG - php.config.phpInfo.PhpInfoUtil - Loaded helper: /opt/.phpstorm_helpers/phpinfo.php
2020-11-27 09:14:01,106 [ 479917] INFO - .CloudSilentLoggingHandlerImpl - Creating container...
2020-11-27 09:14:02,019 [ 480830] INFO - .CloudSilentLoggingHandlerImpl - Creating container...
2 Docker containers are created after Remote PHP Interpreter settings applied however they don't seem to be activating and logs inside the container doesn't seem to say anything
if try starting "phpstorm_helpers_PS-191.8026.56" container manually from docker desktop it seems to start ok
if I manually try to start "festive_zhukovsky..." container it doesn't start.
logs inside container prints xml:
https://drive.google.com/file/d/1d5XbkJdHnc7vuN0V7heJdx3lBkmJfs3V/view?usp=sharing
UPDATE 2
if i remove local PHP version which comes from xampp package in PHPStorm the windows on the right shows where PHPStorm is hanging and become unresponsive:
UPDATE 3
according to this article https://ollyxar.com/blog/docker-phpstorm-windows
Docker should have Shared Drives configuration
however I don't seem to have this option in Docker Desktop Settings:
Can this be a problem?

docker-compose error "read-only file system"

I designed a docker-compose.yml file that also supposed to work with individual volumes.
I created a raid-drive which is mounted as /dataraid to my system. I can read/write to the system, but when using it in my compose file, I get read-only file system error messages.
Adjusting the volumes to a other path like /home/myname/test the compose file works.
I have no idea what the /dataraid makes it "read-only".
What are the permissions settings a compose file needs?
error message:
ERROR: for db Cannot start service db: error while creating mount source path '/dataraid/nextcloud/mariadb': mkdir /dataraid: read-only file system
compose:
version: '3'
services:
db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- /dataraid/nextcloud/mariadb:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=PASSWORD
env_file:
- db.env
redis:
image: redis
restart: always
app:
image: nextcloud:fpm
restart: always
volumes:
- /dataraid/nextcloud/html:/var/www/html
environment:
- MYSQL_HOST=db
env_file:
- db.env
depends_on:
- db
- redis
web:
build: ./web
restart: always
volumes:
- /dataraid/nextcloud/html:/var/www/html:ro
environment:
- VIRTUAL_HOST=name.de
- LETSENCRYPT_HOST=name.de
- LETSENCRYPT_EMAIL=x#y.de
depends_on:
- app
ports:
- 4080:80
networks:
- proxy-tier
- default
collabora:
image: collabora/code
expose:
- 9980
cap_add:
- MKNOD
environment:
- domain=name.de
- VIRTUAL_HOST=name.de
- VIRTUAL_PORT=9980
- VIRTUAL_PROTO=https
- LETSENCRYPT_HOST=name.de
- LETSENCRYPT_EMAIL=x#y.de
- username= #optional
- password= #optional
networks:
- proxy-tier
restart: always
cron:
build: ./app
restart: always
volumes:
- /dataraid/nextcloud/html:/var/www/html
entrypoint: /cron.sh
depends_on:
- db
- redis
proxy:
build: ./proxy
restart: always
ports:
- 443:443
- 80:80
environment:
- VIRTUAL_PROTO=https
- VIRTUAL_PORT=443
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
volumes:
- /dataraid/nextcloud/nginx-certs:/etc/nginx/certs:ro
- /dataraid/nextcloud/nginx-vhost.d:/etc/nginx/vhost.d
- /dataraid/nextcloud/nginx-html:/usr/share/nginx/html
- /dataraid/nextcloud/nginx-conf.d:/etc/nginx/conf.d
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- proxy-tier
letsencrypt-companion:
image: jrcs/letsencrypt-nginx-proxy-companion
restart: always
volumes:
- /dataraid/nextcloud/nginx-certs:/etc/nginx/certs
- /dataraid/nextcloud/nginx-vhost.d:/etc/nginx/vhost.d
- /dataraid/nextcloud/nginx-html:/usr/share/nginx/html
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- proxy-tier
depends_on:
- proxy
networks:
proxy-tier:
see error messages:
bernd#sys-dock:/dataraid/Docker-Configs/nextcloud$ docker-compose up -d
Creating network "nextcloud_default" with the default driver
Creating network "nextcloud_proxy-tier" with the default driver
Creating nextcloud_db_1 ...
Creating nextcloud_proxy_1 ... error
Creating nextcloud_db_1 ... error
Creating nextcloud_collabora_1 ...
ERROR: for nextcloud_proxy_1 Cannot start service proxy: error while creating mount source path '/dataraid/nextcloud/nginx-certs': mkdir /dataraid: read-only file system
Creating nextcloud_redis_1 ... done
Creating nextcloud_collabora_1 ... done
ERROR: for proxy Cannot start service proxy: error while creating mount source path '/dataraid/nextcloud/nginx-certs': mkdir /dataraid: read-only file system
ERROR: for db Cannot start service db: error while creating mount source path '/dataraid/nextcloud/mariadb': mkdir /dataraid: read-only file system
ERROR: Encountered errors while bringing up the project.
If docker starts before the filesystem gets mounted, you could be seeing issues with the docker engine trying to write to the parent filesystem. You can restart the docker daemon to rule this out (systemctl restart docker in systemd base environments).
If restarting the daemon helps, then you can add a dependency between the docker engine and the external filesystem mounts. In systemd, that involves an After= clause in the unit file. E.g. you could create a /etc/systemd/system/docker.service.d/override.conf file containing:
[Unit]
After=nfs-client.target
(Note that I'm not sure that nfs-client.target is the correct unit file for your
filesystem, you'll want to check where it gets mounted.)
Another issue I've seen people encounter recently is Snap based docker installs, which run docker inside of another container technology, which would prevent access to paths not explicitly configured in the Snap.

Resources