-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add dockerfile and docker-compose file for cdms databases #12
Conversation
To recreate everything, please run |
Thank you @faysal-ishtiaq - I'm really excited about this.
In case it's useful... I edited your comment above to collapse the logs using the
This renders the logs section collapsed: MIDAS Logs
|
@isedwards I saw your comment on the PR. I will sit with it tomorrow again and try to investigate on it. However,
MIDAS Logs
|
@isedwards I just looked into the issues again. And here are my observations.
mysql -P 3307 --protocol tcp -u root -p
Enter password:
ERROR 1043 (08S01): Bad handshake
Please let me know if I should split the docker-compose file into multiple files. However, I could not find any reference on importing a docker-compose file into another. But we can do something like this, |
For the error below, the most likely cause of the problem is that you're using a more recent version of the MySQL CLI which is attempting to connect using a different method of authentication.
You can see the version you have installed locally using |
@faysal-ishtiaq would you be happy to make the following changes:
DefaultThe default service, called opencdms-db(this service uses the default Dockerfile in
GroupsDatabase groups contain schemas for several CDMSs that use a comparable database technology. postgresql
mariadb(for MCH to run on MariaDB 10.1 instead of MySQL 5.1 you'll need to use your extra
oracle-xe
ProductionProduction images provide a single CDMS's schema running on the database type and version that it runs on in production (midas is not available here since it runs on Oracle Enterprise or Oracle Standard in production rather than the free version of Oracle) clide
climsoft-4.1.1
mch-englishMySQL 5.1.73 image is currently experimental
wmdr
|
@faysal-ishtiaq I'm intending that these containers will be used for testing, therefore it's possible that developers will already have local database(s) running on the common port numbers. To avoid issues, let's prefix our port numbers with 1,2 or 3 depening on which category the image belongs to below. Also:
Test images categories1. Default
2. Groups
3. Production
|
I have updated the PR with the port mappings. Also there was an issue with
CREATE DATABASE IF NOT EXISTS mch_english;
USE mch_english;
SET GLOBAL sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
Please let me know if it's okay or there is a better way to do this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@faysal-ishtiaq - I like the solution of automating the cat
command within the dockerfile.
The only alternative that springs to mind is MySQL's --init-command
command line argument which would allow the three statements to be executed prior to restoring the SQL. But it's probably not relevant here when automating with containers.
@isedwards
I have created a docker-compose file that starts required database engine for each CDMS.
Also created dockerfiles residing in
containers
directory. These dockerfiles usually fetches the required image and places ddl file into/docker-entrypoint-initdb.d/
directory so that they are executed when initializing a fresh instance.There are few things to be discussed.
scripts/entrypoints/clide.sh
and placed them in/docker-entrypoint-initdb.d/
to be executed before the ddl file is executedMYSQL_ROOT_PASSWORD
in docker-compose envirmonement. It would be great if there is initialization script support as there is in regular MySQL/PostgreSQL/Oracle docker images using scripts placed in/docker-entrypoint-initdb.d/
MIDAS Logs
schemas/wmdr/wmdr_ddl.sql
I am attaching the logs for your reference.WMDR logs
Let me know if I have to change my approach. Please advise on my next steps.