sameersbn / docker-mysql

A Dockerfile that installs a mysql server
MIT License
247 stars 173 forks source link

Cannot run image #19

Closed dpedu closed 9 years ago

dpedu commented 9 years ago

Using the example from the readme:

docker run --name mysql -d \
  -e 'DB_NAME=dbname' sameersbn/mysql:latest

Results:

# docker logs mysql
Installing database...
Could not connect to mysql server. Aborting...

Seems to be a permissions error on /tmp/:

root@core01:~# docker run --name mysql -it -e 'DB_NAME=dbname' sameersbn/mysql:latest bash
/root@bcefdfcb16b1:/# chmod 777 /tmp
root@bcefdfcb16b1:/# /sbin/entrypoint.sh &
[1] 25
root@bcefdfcb16b1:/# Installing database...
Starting MySQL server...
Waiting for database server to accept connections..
Creating debian-sys-maint user...
Creating database "dbname"...
151001 06:52:13 mysqld_safe Logging to syslog.
151001 06:52:13 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

root@bcefdfcb16b1:/# ps -ejHf
UID        PID  PPID  PGID   SID  C STIME TTY          TIME CMD
root         1     0     1     1  0 06:51 ?        00:00:00 bash
root        25     1    25     1  0 06:52 ?        00:00:00   /bin/sh /usr/bin/mysqld_safe
mysql     1228    25    25     1  1 06:52 ?        00:00:00     /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock
root      1229    25    25     1  0 06:52 ?        00:00:00     logger -t mysqld -p daemon.error
root      1247     1  1247     1  0 06:52 ?        00:00:00   ps -ejHf
root@bcefdfcb16b1:/#

And without the chmod step:

root@core01:~# docker run --name mysql -it -e 'DB_NAME=dbname' sameersbn/mysql:latest bash
root@fae184744de6:/# /sbin/entrypoint.sh &
[1] 25
root@fae184744de6:/# Installing database...

[1]+  Exit 1                  /sbin/entrypoint.sh
root@fae184744de6:/# /sbin/entrypoint.sh &
[1] 84
Could not connect to mysql server. Aborting...

[1]+  Exit 1                  /sbin/entrypoint.sh
root@fae184744de6:/#

I'm using Docker version 1.7.1, build 786b29d

sameersbn commented 9 years ago

@dpedu could be something wrong with the image after it was pulled from the hub. Can you retry removing the image and re-pulling from the index.

dpedu commented 9 years ago

Interesting, looks like it was one of the ubuntu base images that was messed up. Thanks!!

sameersbn commented 9 years ago

yea. I have always seen this issue with docker.