docker run --name jira1 -p 8181:8181 -it --entrypoint bash docker.example.com/jira:0.0.1-SNAPSHOT
Install MySQL
1 2
mkdir /var/lib/mysql installMysql.sh
Start MySQL
1
/etc/init.d/mysql bootstrap-pxc
Test MySQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.26-74.0-56 Percona XtraDB Cluster (GPL), Release rel74.0, Revision 624ef81, WSREP version 25.12, wsrep_25.12
Copyright (c) 2009-2015 Percona LLC and/or its affiliates Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Yaml file runs every time the container starts if using dockerStart.py as the entrypoint or cmd.
Jira.py runs before the container starts.
Jira.py can also run the container with a different command. This is how it can configure the database.
The container is run with a command to installmysql. This creates files that arw mapped to the host. That container exits and a new container runs jira.
Take a look at mysql.py. its doing similar things.