vagrantで起動したVM内で立ち上げているDockerのVolume(MySQLデータ永続化)で書き込みエラーになる件の対処

MySQLエラー解消DockerVagrantVirtualBox
vagrantで起動したVM内で立ち上げているDockerのVolume(MySQLデータ永続化)で書き込みエラーになる件の対処
Memo

vagrantで起動したVM内で立ち上げているDockerのVolume(データ永続化)でエラーになる件の対処についてメモしました。

エラーが発生した経緯

最近Dockerのアプリケーションを利用する際にVagrantで開発環境を構築することが多くあります。
その際にアプリケーションのリポジトリはホスト側へ配置しsynced_folderでVM内へデータを渡していています。
そしてそのsynced_folderで渡しているデータをさらにDockerのVolumeでコンテナへマウントしているという状態になっていてマウントの多段構成が発生しております。

そうなると発生するのが書き込みができないというエラーです。

環境

  • MariaDB 10.5.10
  • Docker 20.10.2
  • docker-compose1.25.0

発生したエラー

下記のdocker-composeで起動した際にエラーが発生します。

docker-compose.yml

docker-compose.ymlの内容になります。

docker-compose.yml
version: '3' services: mariadb: image: mariadb command: mysqld ports: - 3309:3306 environment: MYSQL_DATABASE: sample_db MYSQL_ROOT_PASSWORD: root_passw0d MYSQL_USER: sample_user MYSQL_PASSWORD: sample_passw0d user: mysql volumes: - ./data:/var/lib/mysql

実行ログ

docker-compose up -dコマンドを実行したログになります。

terminal
$ docker-compose up Starting mariadb_mariadb_1 ... done Attaching to mariadb_mariadb_1 mariadb_1 | 2021-06-09 04:03:10+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started. mariadb_1 | 2021-06-09 04:03:10+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' mariadb_1 | 2021-06-09 04:03:10+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started. mariadb_1 | 2021-06-09 04:03:10+00:00 [Note] [Entrypoint]: Initializing database files mariadb_1 | 2021-06-09 4:03:10 0 [Warning] Can't create test file /var/lib/mysql/29f95ac9dd14.lower-test mariadb_1 | 2021-06-09 4:03:10 0 [ERROR] mysqld: Can't create/write to file '/var/lib/mysql/aria_log_control' (Errcode: 13 "Permission denied") mariadb_1 | 2021-06-09 4:03:10 0 [ERROR] mysqld: Got error 'Can't create file' when trying to use aria control file '/var/lib/mysql/aria_log_control' mariadb_1 | 2021-06-09 4:03:10 0 [ERROR] Plugin 'Aria' init function returned error. mariadb_1 | 2021-06-09 4:03:10 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed. mariadb_1 | 2021-06-09 4:03:11 0 [ERROR] InnoDB: Operating system error number 13 in a file operation. mariadb_1 | 2021-06-09 4:03:11 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory. mariadb_1 | 2021-06-09 4:03:11 0 [ERROR] InnoDB: Operating system error number 13 in a file operation. mariadb_1 | 2021-06-09 4:03:11 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory. mariadb_1 | 2021-06-09 4:03:11 0 [ERROR] InnoDB: Cannot open datafile './ibdata1' mariadb_1 | 2021-06-09 4:03:11 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data! mariadb_1 | 2021-06-09 4:03:11 0 [ERROR] InnoDB: Database creation was aborted with error Cannot open a file. You may need to delete the ibdata1 file before trying to start up again. mariadb_1 | 2021-06-09 4:03:11 0 [ERROR] Plugin 'InnoDB' init function returned error. mariadb_1 | 2021-06-09 4:03:11 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. mariadb_1 | 2021-06-09 4:03:11 0 [ERROR] Failed to initialize plugins. mariadb_1 | 2021-06-09 4:03:11 0 [ERROR] Aborting mariadb_1 | mariadb_1 | Installation of system tables failed! Examine the logs in mariadb_1 | /var/lib/mysql/ for more information. mariadb_1 | mariadb_1 | The problem could be conflicting information in an external mariadb_1 | my.cnf files. You can ignore these by doing: mariadb_1 | mariadb_1 | shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf mariadb_1 | mariadb_1 | You can also try to start the mysqld daemon with: mariadb_1 | mariadb_1 | shell> /usr/sbin/mysqld --skip-grant-tables --general-log & mariadb_1 | mariadb_1 | and use the command line tool /usr/bin/mysql mariadb_1 | to connect to the mysql database and look at the grant tables: mariadb_1 | mariadb_1 | shell> /usr/bin/mysql -u root mysql mariadb_1 | mysql> show tables; mariadb_1 | mariadb_1 | Try 'mysqld --help' if you have problems with paths. Using mariadb_1 | --general-log gives you a log in /var/lib/mysql/ that may be helpful. mariadb_1 | mariadb_1 | The latest information about mysql_install_db is available at mariadb_1 | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db mariadb_1 | You can find the latest source at https://downloads.mariadb.org and mariadb_1 | the maria-discuss email list at https://launchpad.net/~maria-discuss mariadb_1 | mariadb_1 | Please check all of the above before submitting a bug report mariadb_1 | at https://mariadb.org/jira mariadb_1 | mariadb_mariadb_1 exited with code 1

書き込みができないエラー

volumeへ設定した/var/lib/mysql/へ書き込みができないというエラーが発生しています。

mysqld: Can't create/write to file '/var/lib/mysql/aria_log_control' (Errcode: 13 "Permission denied")

原因

コンテナ内のmysqlユーザがDBの設定をいこなう際に
データが書き込めないためエラーになっています。

解決手順

下記で記載していますが権限を合わせても解決できなかったため
データの永続化は名前付きボリュームにする形で解決しています。

docker-compose.ymlを修正

docker-compose.yml
version: '3' services: mariadb: image: mariadb command: mysqld ports: - 3309:3306 environment: MYSQL_DATABASE: sample_db MYSQL_ROOT_PASSWORD: root_passw0d MYSQL_USER: sample_user MYSQL_PASSWORD: sample_passw0d volumes: - mysql-data:/var/lib/mysql volumes: mysql-data: driver_opts: type: none device: /home/vagrant/data o: bind

volumeの作成

mysql-dataというvolumeを作成しています。

volumes:
  mysql-data:
    driver_opts:
      type: none
      device: /home/vagrant/data
      o: bind

データは/home/vagrant/dataへ保存させる設定を行っています。

volumeの設定

コンテナ側の/var/lib/mysqlに対して
作成したmysql-dataを設定しています。

    volumes:
      - mysql-data:/var/lib/mysql

再度コンテナを立ち上げ

docker-compose upコマンドで再度コンテナを立ち上げます。

terminal
$ docker-compose up Creating volume "mariadb_mysql-data" with default driver Recreating mariadb_mariadb_1 ... done Attaching to mariadb_mariadb_1 mariadb_1 | 2021-06-09 04:46:37+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started. mariadb_1 | 2021-06-09 04:46:37+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' mariadb_1 | 2021-06-09 04:46:37+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started. mariadb_1 | 2021-06-09 04:46:38+00:00 [Note] [Entrypoint]: Initializing database files mariadb_1 | mariadb_1 | mariadb_1 | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER ! mariadb_1 | To do so, start the server, then issue the following command: mariadb_1 | mariadb_1 | '/usr/bin/mysql_secure_installation' mariadb_1 | mariadb_1 | which will also give you the option of removing the test mariadb_1 | databases and anonymous user created by default. This is mariadb_1 | strongly recommended for production servers. mariadb_1 | mariadb_1 | See the MariaDB Knowledgebase at https://mariadb.com/kb or the mariadb_1 | MySQL manual for more instructions. mariadb_1 | mariadb_1 | Please report any problems at https://mariadb.org/jira mariadb_1 | mariadb_1 | The latest information about MariaDB is available at https://mariadb.org/. mariadb_1 | You can find additional information about the MySQL part at: mariadb_1 | https://dev.mysql.com mariadb_1 | Consider joining MariaDB's strong and vibrant community: mariadb_1 | https://mariadb.org/get-involved/ mariadb_1 | mariadb_1 | 2021-06-09 04:46:39+00:00 [Note] [Entrypoint]: Database files initialized mariadb_1 | 2021-06-09 04:46:39+00:00 [Note] [Entrypoint]: Starting temporary server mariadb_1 | 2021-06-09 04:46:39+00:00 [Note] [Entrypoint]: Waiting for server startup mariadb_1 | 2021-06-09 4:46:39 0 [Note] mysqld (mysqld 10.5.10-MariaDB-1:10.5.10+maria~focal) starting as process 99 ... mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: Uses event mutexes mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: Number of pools: 1 mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions mariadb_1 | 2021-06-09 4:46:39 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts) mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: Using Linux native AIO mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728 mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: Completed initialization of buffer pool mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: 128 rollback segments are active. mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: Creating shared tablespace for temporary tables mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: 10.5.10 started; log sequence number 45106; transaction id 20 mariadb_1 | 2021-06-09 4:46:39 0 [Note] Plugin 'FEEDBACK' is disabled. mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool mariadb_1 | 2021-06-09 4:46:39 0 [Note] InnoDB: Buffer pool(s) load completed at 210609 4:46:39 mariadb_1 | 2021-06-09 4:46:39 0 [Warning] 'user' entry 'root@ee2bb4259dc4' ignored in --skip-name-resolve mode. mariadb_1 | 2021-06-09 4:46:39 0 [Warning] 'proxies_priv' entry '@% root@ee2bb4259dc4' ignored in --skip-name-resolve mode. mariadb_1 | 2021-06-09 4:46:39 0 [Note] Reading of all Master_info entries succeeded mariadb_1 | 2021-06-09 4:46:39 0 [Note] Added new Master_info '' to hash table mariadb_1 | 2021-06-09 4:46:39 0 [Note] mysqld: ready for connections. mariadb_1 | Version: '10.5.10-MariaDB-1:10.5.10+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 0 mariadb.org binary distribution mariadb_1 | 2021-06-09 04:46:40+00:00 [Note] [Entrypoint]: Temporary server started. mariadb_1 | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it. mariadb_1 | Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it. mariadb_1 | Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it. mariadb_1 | 2021-06-09 4:46:45 5 [Warning] 'proxies_priv' entry '@% root@ee2bb4259dc4' ignored in --skip-name-resolve mode. mariadb_1 | 2021-06-09 04:46:45+00:00 [Note] [Entrypoint]: Creating database sample_db mariadb_1 | 2021-06-09 04:46:45+00:00 [Note] [Entrypoint]: Creating user sample_user mariadb_1 | 2021-06-09 04:46:45+00:00 [Note] [Entrypoint]: Giving user sample_user access to schema sample_db mariadb_1 | mariadb_1 | 2021-06-09 04:46:45+00:00 [Note] [Entrypoint]: Stopping temporary server mariadb_1 | 2021-06-09 4:46:45 0 [Note] mysqld (initiated by: root[root] @ localhost []): Normal shutdown mariadb_1 | 2021-06-09 4:46:45 0 [Note] Event Scheduler: Purging the queue. 0 events mariadb_1 | 2021-06-09 4:46:45 0 [Note] InnoDB: FTS optimize thread exiting. mariadb_1 | 2021-06-09 4:46:45 0 [Note] InnoDB: Starting shutdown... mariadb_1 | 2021-06-09 4:46:45 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool mariadb_1 | 2021-06-09 4:46:45 0 [Note] InnoDB: Buffer pool(s) dump completed at 210609 4:46:45 mariadb_1 | 2021-06-09 4:46:45 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" mariadb_1 | 2021-06-09 4:46:45 0 [Note] InnoDB: Shutdown completed; log sequence number 45118; transaction id 21 mariadb_1 | 2021-06-09 4:46:45 0 [Note] mysqld: Shutdown complete mariadb_1 | mariadb_1 | 2021-06-09 04:46:46+00:00 [Note] [Entrypoint]: Temporary server stopped mariadb_1 | mariadb_1 | 2021-06-09 04:46:46+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up. mariadb_1 | mariadb_1 | 2021-06-09 4:46:46 0 [Note] mysqld (mysqld 10.5.10-MariaDB-1:10.5.10+maria~focal) starting as process 1 ... mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: Uses event mutexes mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: Number of pools: 1 mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions mariadb_1 | 2021-06-09 4:46:46 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts) mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: Using Linux native AIO mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728 mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: Completed initialization of buffer pool mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: 128 rollback segments are active. mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: Creating shared tablespace for temporary tables mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: 10.5.10 started; log sequence number 45118; transaction id 20 mariadb_1 | 2021-06-09 4:46:46 0 [Note] Plugin 'FEEDBACK' is disabled. mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool mariadb_1 | 2021-06-09 4:46:46 0 [Note] InnoDB: Buffer pool(s) load completed at 210609 4:46:46 mariadb_1 | 2021-06-09 4:46:46 0 [Note] Server socket created on IP: '::'. mariadb_1 | 2021-06-09 4:46:46 0 [Warning] 'proxies_priv' entry '@% root@ee2bb4259dc4' ignored in --skip-name-resolve mode. mariadb_1 | 2021-06-09 4:46:46 0 [Note] Reading of all Master_info entries succeeded mariadb_1 | 2021-06-09 4:46:46 0 [Note] Added new Master_info '' to hash table mariadb_1 | 2021-06-09 4:46:46 0 [Note] mysqld: ready for connections. mariadb_1 | Version: '10.5.10-MariaDB-1:10.5.10+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution

無事立ち上げることができました。

権限のを合わせて確認したログ

共有フォルダの権限をmysqlユーザー権限を合わせてコンテナを立ち上げてみます。
こちらは結果的にうまくいきませんでした。

権限の確認

VMとコンテナ内の権限を確認してみます。

VMの権限

ユーザーとグループを確認

volumeへ設定しているdataディレクトリのユーザーとグループを確認します。

terminal
$ ls -la data total 110952 drwxr-xr-x 1 vagrant vagrant 192 Jun 9 13:08 . drwxr-xr-x 1 vagrant vagrant 192 Jun 9 12:56 .. -rwxr-xr-x 1 vagrant vagrant 8192 Jun 9 13:08 aria_log.00000001

uidの確認

ユーザーのuidを確認します。

terminal
$ id -u vagrant 1000

gidの確認

グループのgidを確認します。

terminal
id -g vagrant 1000

コンテナの権限

コンテナのコマンドを修正

コンテナはエラーが発生して終了いるため一時的に起動したままにするために
5行目のcommandの記述を変更します。

docker-compose.yml
command: ['/bin/sh', '-c', 'while :; do sleep 10; done']

コンテナをバックグラウンドで立ち上げ

コンテナをバックグラウンドで立ち上げます。

terminal
$ docker-compose up -d

コンテナへログイン

コンテナへログインします。

terminal
$ docker exec -it mariadb_mariadb_1 bash

uidの確認

ユーザーのuidを確認します。

terminal|コンテナ
I have no name!@9056d58b115b:/$ id -u mysql 999

gidの確認

グループのgidを確認します。

terminal|コンテナ
I have no name!@9056d58b115b:/$ id -g mysql 999

権限を合わせて起動

docker-compose.yml

docker-compose.ymlの内容になります。

docker-compose.yml
version: '3' services: mariadb: image: mariadb command: mysqld ports: - 3309:3306 environment: MYSQL_DATABASE: sample_db MYSQL_ROOT_PASSWORD: root_passw0d MYSQL_USER: sample_user MYSQL_PASSWORD: sample_passw0d user: 1000:1000 volumes: - ./data:/var/lib/mysql

userの変更

実行するユーザーの権限をホスト側のdataディレクトリと同じ uid:1000とgid:1000へ変更しています。

    user: 1000:1000

実行ログ

docker-compose up -dコマンドを実行したログになります。

###

$ docker-compose up
Starting mariadb_mariadb_1 ... done
Attaching to mariadb_mariadb_1
mariadb_1  | 2021-06-09 04:08:32+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started.
mariadb_1  | 2021-06-09 04:08:32+00:00 [Note] [Entrypoint]: Initializing database files
mariadb_1  | 2021-06-09 04:08:34 0x7f1964bbd700  InnoDB: Assertion failure in file /home/buildbot/buildbot/build/mariadb-10.5.10/storage/innobase/os/os0file.cc line 3867
mariadb_1  | InnoDB: Failing assertion: cb->m_err == DB_SUCCESS
mariadb_1  | InnoDB: We intentionally generate a memory trap.
mariadb_1  | InnoDB: Submit a detailed bug report to https://jira.mariadb.org/
mariadb_1  | InnoDB: If you get repeated assertion failures or crashes, even
mariadb_1  | InnoDB: immediately after the mysqld startup, there may be
mariadb_1  | InnoDB: corruption in the InnoDB tablespace. Please refer to
mariadb_1  | InnoDB: https://mariadb.com/kb/en/library/innodb-recovery-modes/
mariadb_1  | InnoDB: about forcing recovery.
mariadb_1  | 210609  4:08:34 [ERROR] mysqld got signal 6 ;
mariadb_1  | This could be because you hit a bug. It is also possible that this binary
mariadb_1  | or one of the libraries it was linked against is corrupt, improperly built,
mariadb_1  | or misconfigured. This error can also be caused by malfunctioning hardware.
mariadb_1  | 
mariadb_1  | To report this bug, see https://mariadb.com/kb/en/reporting-bugs
mariadb_1  | 
mariadb_1  | We will try our best to scrape up some info that will hopefully help
mariadb_1  | diagnose the problem, but since we have already crashed, 
mariadb_1  | something is definitely wrong and this may fail.
mariadb_1  | 
mariadb_1  | Server version: 10.5.10-MariaDB-1:10.5.10+maria~focal
mariadb_1  | key_buffer_size=134217728
mariadb_1  | read_buffer_size=131072
mariadb_1  | max_used_connections=0
mariadb_1  | max_threads=153
mariadb_1  | thread_count=0
mariadb_1  | It is possible that mysqld could use up to 
mariadb_1  | key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467871 K  bytes of memory
mariadb_1  | Hope that's ok; if not, decrease some variables in the equation.
mariadb_1  | 
mariadb_1  | Thread pointer: 0x0
mariadb_1  | Attempting backtrace. You can use the following information to find out
mariadb_1  | where mysqld died. If you see no messages after this, something went
mariadb_1  | terribly wrong...
mariadb_1  | 2021-06-09 04:08:34 0x7f194effd700  InnoDB: Assertion failure in file /home/buildbot/buildbot/build/mariadb-10.5.10/storage/innobase/os/os0file.cc line 3867
mariadb_1  | InnoDB: Failing assertion: cb->m_err == DB_SUCCESS
mariadb_1  | InnoDB: We intentionally generate a memory trap.
mariadb_1  | InnoDB: Submit a detailed bug report to https://jira.mariadb.org/
mariadb_1  | InnoDB: If you get repeated assertion failures or crashes, even
mariadb_1  | InnoDB: immediately after the mysqld startup, there may be
mariadb_1  | InnoDB: corruption in the InnoDB tablespace. Please refer to
mariadb_1  | InnoDB: https://mariadb.com/kb/en/library/innodb-recovery-modes/
mariadb_1  | InnoDB: about forcing recovery.
mariadb_1  | Aborted (core dumped)
mariadb_1  | 
mariadb_1  | Installation of system tables failed!  Examine the logs in
mariadb_1  | /var/lib/mysql/ for more information.
mariadb_1  | 
mariadb_1  | The problem could be conflicting information in an external
mariadb_1  | my.cnf files. You can ignore these by doing:
mariadb_1  | 
mariadb_1  |     shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf
mariadb_1  | 
mariadb_1  | You can also try to start the mysqld daemon with:
mariadb_1  | 
mariadb_1  |     shell> /usr/sbin/mysqld --skip-grant-tables --general-log &
mariadb_1  | 
mariadb_1  | and use the command line tool /usr/bin/mysql
mariadb_1  | to connect to the mysql database and look at the grant tables:
mariadb_1  | 
mariadb_1  |     shell> /usr/bin/mysql -u root mysql
mariadb_1  |     mysql> show tables;
mariadb_1  | 
mariadb_1  | Try 'mysqld --help' if you have problems with paths.  Using
mariadb_1  | --general-log gives you a log in /var/lib/mysql/ that may be helpful.
mariadb_1  | 
mariadb_1  | The latest information about mysql_install_db is available at
mariadb_1  | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
mariadb_1  | You can find the latest source at https://downloads.mariadb.org and
mariadb_1  | the maria-discuss email list at https://launchpad.net/~maria-discuss
mariadb_1  | 
mariadb_1  | Please check all of the above before submitting a bug report
mariadb_1  | at https://mariadb.org/jira
mariadb_1  | 
mariadb_mariadb_1 exited with code 1

エラーについて

リンク先のライブラリのが破損しているか、不適切にビルドされています。
といったエラーが出ています。

mariadb_1  | 210609  4:08:34 [ERROR] mysqld got signal 6 ;
mariadb_1  | This could be because you hit a bug. It is also possible that this binary
mariadb_1  | or one of the libraries it was linked against is corrupt, improperly built,
mariadb_1  | or misconfigured. This error can also be caused by malfunctioning hardware.

こちらについては引き続き調査して何かわかったらまた記事にしたいと思います。

終わりに

最後までご覧いただきありがとうございます。
この記事ではvagrantで起動したVM内で立ち上げているDockerのVolume(MySQLデータ永続化)で書き込みエラーになる件の対処について紹介させていただきました。

これからも皆様の開発に役立つ情報を提供していきたいと考えています。
今後ともよろしくお願いいたします。