我正在尝试使用docker-compose从docker hub的vanilla mariadb
图像启动一个docker容器。虽然以前一切正常,但我现在收到错误消息Can't create/write to file '/tmp/ibLTxiq7' (Errcode: 13 "Permission denied")
。这是完整的日志:
139707238336448 [Note] /usr/sbin/mysqld (mysqld 10.1.14-MariaDB-1~jessie) starting as process 51 ...
139707238336448 [Note] InnoDB: Using mutexes to ref count buffer pool pages
139707238336448 [Note] InnoDB: The InnoDB memory heap is disabled
139707238336448 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
139707238336448 [Note] InnoDB: Memory barrier is not used
139707238336448 [Note] InnoDB: Compressed tables use zlib 1.2.8
139707238336448 [Note] InnoDB: Using Linux native AIO
139707238336448 [Note] InnoDB: Using SSE crc32 instructions
139707238336448 [ERROR] mysqld: Can't create/write to file '/tmp/ibLTxiq7' (Errcode: 13 "Permission denied")
7f10205047c0 InnoDB: Error: unable to create temporary file; errno: 13
139707238336448 [ERROR] Plugin 'InnoDB' init function returned error.
139707238336448 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
139707238336448 [ERROR] Unknown/unsupported storage engine: InnoDB
139707238336448 [ERROR] Aborting
我不明白,日志中的/tmp
文件夹是指主机还是容器?我该如何解决这个问题?
我尝试运行的命令(以root用户身份)是docker-compose up db
。我已经检查过磁盘上确实有空间。我的操作系统Ubuntu 16.04。
更新:我的docker-compose.yml-file
https-portal:
image: steveltn/https-portal
ports:
- '80:80'
- '443:443'
links:
- wordpress
restart: always
environment:
DOMAINS: 'domain.com -> http://wordpress'
STAGE: 'production'
wordpress:
image: wordpress
links:
- db:mysql
volumes:
- ~/wordpress/wp_html:/var/www/html
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: [---]
更新2:
我似乎已经(至少暂时)通过为db容器添加卷装入路径来解决问题,而且令人惊讶:
db:
image: mariadb
volumes:
- /data/maridb:/var/lib/mysql
然而这实际上并没有影响任何事情,它只是打印一个警告,表示卷装载未被使用(事实上它不是)因为容器以前有过使用不同的卷创建并使用旧的卷。 仍然,原始问题消失了。有关导致这种行为的原因的任何想法?