X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=deliveries%2FDockerfile.mariadb;h=7310585ba323c88a29cb4f6596612374457ebdd0;hb=b87e50318bc8b11a065b6ba55b577442aefb20ba;hp=5b0abd513a9b2bd18f72450c331678d9c97c31de;hpb=978dbcf0a196acbafad72fe1e2478ec0e384f02f;p=portal.git diff --git a/deliveries/Dockerfile.mariadb b/deliveries/Dockerfile.mariadb index 5b0abd51..7310585b 100644 --- a/deliveries/Dockerfile.mariadb +++ b/deliveries/Dockerfile.mariadb @@ -1,28 +1,34 @@ -FROM mariadb:latest +FROM mariadb:10.5.5 -ARG PORTAL_SCRIPT_DIR=${PORTAL_SCRIPT_DIR} -ARG SDK_SCRIPT_DIR=${SDK_SCRIPT_DIR} -ARG DBC_SCRIPT_DIR=${DBC_SCRIPT_DIR} +ARG DB_SCRIPT_DIR=${DB_SCRIPT_DIR} # constant #Add config file COPY my.cnf /etc/mysql/my.cnf -#ADD cluster.cnf /etc/mysql/conf.d + +# mysql user and group already created by mariadb image + +ARG user=mysql +ARG group=mysql + +RUN mkdir /opt/$user && chown -R $user:$group /opt/$user # Scripts are executed in alphabetical order -# Portal DDL and DML at 1710 -COPY ${PORTAL_SCRIPT_DIR}/EcompPortalDDLMySql_1710_Common.sql /docker-entrypoint-initdb.d/ -COPY ${PORTAL_SCRIPT_DIR}/EcompPortalDDLMySql_1710_OS.sql /docker-entrypoint-initdb.d/ -COPY ${PORTAL_SCRIPT_DIR}/EcompPortalDMLMySql_1710_Common.sql /docker-entrypoint-initdb.d/ -COPY ${PORTAL_SCRIPT_DIR}/EcompPortalDMLMySql_1710_OS.sql /docker-entrypoint-initdb.d/ -COPY Apps_Users_OnBoarding_Script.sql /docker-entrypoint-initdb.d/EcompPortalDMLMySql_1710_z_apps_users.sql - -# SDK App DDL and DML unchanged since 1707 -COPY ${SDK_SCRIPT_DIR}/EcompSdkDDLMySql_1707_Common.sql /docker-entrypoint-initdb.d/ -COPY ${SDK_SCRIPT_DIR}/EcompSdkDDLMySql_1707_OS.sql /docker-entrypoint-initdb.d/ -COPY ${SDK_SCRIPT_DIR}/EcompSdkDMLMySql_1707_Common.sql /docker-entrypoint-initdb.d/ -COPY ${SDK_SCRIPT_DIR}/EcompSdkDMLMySql_1707_OS.sql /docker-entrypoint-initdb.d/ - -# DBC App combined DDL/DML, built by script -COPY ${DBC_SCRIPT_DIR}/dbca-complete-mysql-1707-os.sql /docker-entrypoint-initdb.d/ +# Portal DDL and DML at v3.3 +COPY ${DB_SCRIPT_DIR}/PortalDDLMySql_3_3_Common.sql /docker-entrypoint-initdb.d/ +COPY ${DB_SCRIPT_DIR}/PortalDDLMySql_3_3_OS.sql /docker-entrypoint-initdb.d/ +COPY ${DB_SCRIPT_DIR}/PortalDMLMySql_3_3_Common.sql /docker-entrypoint-initdb.d/ +COPY ${DB_SCRIPT_DIR}/PortalDMLMySql_3_3_OS.sql /docker-entrypoint-initdb.d/ +# Do not copy the onboarding script here; it's mounted as a volume + +# SDK App DDL and DML +COPY ${DB_SCRIPT_DIR}/EcompSdkDDLMySql_3_3_Common.sql /docker-entrypoint-initdb.d/ +COPY ${DB_SCRIPT_DIR}/EcompSdkDDLMySql_3_3_OS.sql /docker-entrypoint-initdb.d/ +COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_3_3_Common.sql /docker-entrypoint-initdb.d/ +COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_3_3_OS.sql /docker-entrypoint-initdb.d/ + +RUN chown $user:$group /opt /var -R +RUN chmod 777 /var/lib/mysql + +USER mysql