Skip to content

Commit

Permalink
hardcode data dir
Browse files Browse the repository at this point in the history
  • Loading branch information
bmanuel committed Sep 26, 2015
1 parent 9067067 commit cda089e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ fi

if [ "$1" = 'mysqld' ]; then
# Get config
DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')"
DATADIR="/var/lib/mysql"

if [ ! -d "$DATADIR/mysql" ]; then
if [ ! -d "$DATADIR" ]; then
if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then
echo >&2 'error: database is uninitialized and MYSQL_ROOT_PASSWORD not set'
echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?'
exit 1
fi
echo "DATAIR: $DATADIR"
echo "DATADIR: $DATADIR"
mkdir -p "$DATADIR"
chown -R mysql:mysql "$DATADIR"

Expand Down

0 comments on commit cda089e

Please sign in to comment.