添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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 set -eo pipefail addition to docker-entrypoint.sh in ed198ce prevents mysqld from booting set -eo pipefail addition to docker-entrypoint.sh in ed198ce prevents mysqld from booting hhowe29 opened this issue Jan 28, 2016 · 7 comments

We have a mysql docker image that we could build and boot fine before this commit from 1/20. After this change, mysqld never gets going. No logging is omitted. We traced this to the fact that our my.cnf file contained a log-bin setting:

log-bin=foo-bin

We were able to workaround the problem in two different ways:
1: revert to the previous entrypoint script. ADD it at from the Dockerfile and overwrite the newer script
2: remove the log-bin setting from our my.cnf config.

Posting this in case someone else runs into a similar issue. Our problem seems related to this: https://bugs.mysql.com/bug.php?id=78957

Details:
docker version 1.9.1
fig version 1.0.1
uname -a = Linux vagrant-ubuntu-trusty-64 3.13.0-74-generic #118 -Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

./mysql/Dockerfile :

FROM mysql:5.6.28
run apt-get update && apt-get install -qq -y nano
ADD my.cnf /etc/my.cnf

./mysql/my.cnf:

[mysqld]
bind-address=0.0.0.0
log-bin=foo-bin
console=1
general_log=1
general_log_file=/var/lib/mysql/mysql-general.log
slow_query_log=1
slow_query_log_file=/var/lib/mysql/mysql-slow.log
log_error=/var/lib/mysql/mysql-error.log
collation-server=utf8_unicode_ci
character-set-server=utf8
binlog_format=ROW
server_id=999
transaction-isolation=READ-COMMITTED
sync_binlog=1
sync_frm=1
log_output=TABLE,FILE

./fig file

build: mysql ports: - 3306:3306 environment: MYSQL_ROOT_PASSWORD: supersecret MYSQL_DATABASE: fst MYSQL_USER: fst MYSQL_PASSWORD: ubersecret

commands:

fig rm --force db
fig build db
fig up db
          

After some testing I was able to narrow it down. It was previously silently failing at what should be a non-error on line 11. Running mysqld --verbose --help tries to create a missing file (foo-bin.index) in the datadir that we are running the command to find 😢.

$ # using your same my.cnf
root@b19a7a49d7fb:/# mysqld --verbose --help 1> /dev/null
2016-01-28 19:54:23 0 [Note] mysqld (mysqld 5.6.28-log) starting as process 13 ...
mysqld: File './foo-bin.index' not found (Errcode: 13 - Permission denied)
2016-01-28 19:54:23 13 [ERROR] Aborting
2016-01-28 19:54:23 13 [Note] Binlog end

Still had the cnf file to test, so it was quick 😄.

$ docker run -it --rm -v ~/dicker/tmp/my.cnf:/etc/my.cnf mysql:5.7 bash
root@1786f37224bb:/# mysqld --verbose --help 1> /dev/null
root@1786f37224bb:/# exit
$ docker run -it --rm -v ~/dicker/tmp/my.cnf:/etc/my.cnf mysql:5.5 bash
root@88e09edb144f:/# mysqld --verbose --help 1> /dev/null
160128 20:52:49 [Note] mysqld (mysqld 5.5.47-log) starting as process 12 ...
mysqld: File './foo-bin.index' not found (Errcode: 13)
160128 20:52:49 [ERROR] Aborting
root@88e09edb144f:/# exit

Oh, mktemp doesn't work. We just put /tmp/tmp.index.
--log-bin-index will specify the location of the binlog file, but it won't actually do anything unless log-bin is also enabled

edit: mktemp -u should work