Skip to content
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

Run mysqld as mysql user #1397

Merged
merged 4 commits into from
Dec 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/db/Dockerfile.mariadb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ COPY mariadb-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]

EXPOSE 3306
CMD ["mysqld", "--user=root"]
CMD ["mysqld", "--user=mysql"]
4 changes: 3 additions & 1 deletion deploy/db/mariadb-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [ ! -d "$MYSQL_DATADIR/mysql" ]; then
# fi

echo 'Running mysql_install_db ...'
mysql_install_db --user=root --datadir="$MYSQL_DATADIR"
mysql_install_db --user=mysql --datadir="$MYSQL_DATADIR"
echo 'Finished mysql_install_db'

# These statements _must_ be on individual lines, and _must_ end with
Expand Down Expand Up @@ -42,6 +42,8 @@ EOSQL
set -- "$@" --init-file="$tempSqlFile"
fi

chown -R mysql:mysql "$MYSQL_DATADIR"
mkdir /var/run/mysql
chown -R mysql:mysql /var/run/mysql

exec "$@"