diff options
author | Sunder Tattavarada <statta@research.att.com> | 2020-08-18 17:20:31 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-08-18 17:20:31 +0000 |
commit | db8f1bde5d4ec666321c2bca099c5b3668c8524a (patch) | |
tree | cfcb9822cae916085fc09b26769dfaf712f2291a /deliveries | |
parent | 901a450ade57f991ad05acf66baf37cfd521ea02 (diff) | |
parent | dc2be81a9875ce6e414136a53d55ed01a0a267e2 (diff) |
Merge "Start portal mariadb db docker with non root user"
Diffstat (limited to 'deliveries')
-rw-r--r-- | deliveries/Dockerfile.mariadb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/deliveries/Dockerfile.mariadb b/deliveries/Dockerfile.mariadb index e9c5e9f3..8dffd0e4 100644 --- a/deliveries/Dockerfile.mariadb +++ b/deliveries/Dockerfile.mariadb @@ -6,6 +6,13 @@ ARG DB_SCRIPT_DIR=${DB_SCRIPT_DIR} #Add config file COPY my.cnf /etc/mysql/my.cnf +# 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 v3.2 @@ -20,3 +27,8 @@ COPY ${DB_SCRIPT_DIR}/EcompSdkDDLMySql_3_2_Common.sql /docker-entrypoint-i COPY ${DB_SCRIPT_DIR}/EcompSdkDDLMySql_3_2_OS.sql /docker-entrypoint-initdb.d/ COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_3_2_Common.sql /docker-entrypoint-initdb.d/ COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_3_2_OS.sql /docker-entrypoint-initdb.d/ + +RUN chown $user:$group /opt /var -R +RUN chmod 777 /var/lib/mysql + +USER mysql |