Closed kimhxsong closed 2 years ago
error-log
(main)⚡ % docker run -it test bash ~/Inception/srcs/mariadb
root@e6ab5c6fb394:/#
root@1713c66de6f8:/# mysqld --verbose --help | grep log-error
2022-06-13 13:23:26 0 [Note] Plugin 'FEEDBACK' is disabled.
--log-slow-query-log-file, --log-error-file, and
--log-error[=name] Log errors to file (instead of stdout). If file name is
log-error /var/log/mysql/error.log
root@1713c66de6f8:/# cat /var/log/mysql/error.log
2022-06-13 13:21:00 0 [Note] InnoDB: Using Linux native AIO
2022-06-13 13:21:00 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2022-06-13 13:21:00 0 [Note] InnoDB: Uses event mutexes
2022-06-13 13:21:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-06-13 13:21:00 0 [Note] InnoDB: Number of pools: 1
2022-06-13 13:21:00 0 [Note] InnoDB: Using generic crc32 instructions
2022-06-13 13:21:00 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2022-06-13 13:21:00 0 [Note] InnoDB: Completed initialization of buffer pool
2022-06-13 13:21:00 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2022-06-13 13:21:00 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-06-13 13:21:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-06-13 13:21:00 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-06-13 13:21:00 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-06-13 13:21:00 0 [Note] InnoDB: Waiting for purge to start
2022-06-13 13:21:00 0 [Note] InnoDB: 10.3.34 started; log sequence number 1625443; transaction id 20
2022-06-13 13:21:00 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-06-13 13:21:00 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-06-13 13:21:00 0 [Note] InnoDB: Buffer pool(s) load completed at 220613 13:21:00
2022-06-13 13:21:00 0 [Note] Server socket created on IP: '127.0.0.1'.
2022-06-13 13:21:00 0 [ERROR] Can't start server : Bind on unix socket: No such file or directory
2022-06-13 13:21:00 0 [ERROR] Do you already have another mysqld server running on socket: /run/mysqld/mysqld.sock ?
2022-06-13 13:21:00 0 [ERROR] Aborting
mysql_install_db added
FROM debian:bullseye
RUN groupadd -r mysql && useradd -r -g mysql mysql
RUN apt-get update && \
apt-get install -y \
mariadb-client \
mariadb-server
RUN rm -rf /var/lib/mysql; \
mkdir -p /var/lib/mysql /var/run/mysqld; \
chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \
chmod 777 /var/run/mysqld;
RUN mysql_install_db;
CMD ["mariadbd"]
문제 상황 : 컨테이너가
mysqld
을 실행하면 에러를 반환하고 종료됨Dockerfile
참고: https://mariadb.com/kb/en/creating-a-custom-docker-image/#dockerfile-syntax
Container Statuses
=> 커맨드 실행 직후 종료
Checking what arguments a local mysqld was run with
mysqld options
-b, --basedir=name
-h, --datadir=name
--plugin-dir=name
--log-error[=name]
--pid-file=name