+++ /dev/null
-FROM osdn/debian-jessie-amd64
-MAINTAINER OSDN, Corp. <info@osdn.jp>
-
-
-RUN apt-get update
-ENV DEBIAN_FRONTEND=noninteractive
-RUN apt-get -y install mysql-server-5.5
-
-ENTRYPOINT ["/run-mysql-server.sh"]
-
-EXPOSE 3306
-CMD ["mysqld"]
-VOLUME /var/lib/mysql
-
-COPY files/srad-test.cnf /etc/mysql/conf.d/srad.cnf
-#COPY files/first-run.sql /root/first-run.sql
-
-COPY files/run-mysql-server.sh /run-mysql-server.sh
-RUN chmod 755 /run-mysql-server.sh
-
-
+++ /dev/null
-date := $(shell date +%y-%m-%d)
-REPO := sdtest.osdn.co.jp:5000
-
-image:
- docker build -t osdn/srad-db:$(date) .
- docker tag osdn/srad-db:$(date) osdn/srad-db:latest
- docker tag osdn/srad-db:$(date) $(REPO)/osdn/srad-db:latest
-
-push:
- docker push $(REPO)/osdn/srad-db:latest
-
-run:
- docker run -d --name srad-db -v /fioa1/srad-db:/var/lib/mysql osdn/srad-db
+++ /dev/null
-/* initial setup sql for srad-db */
-CREATE DATABASE slash;
-CREATE USER slash;
-GRANT ALL ON slash.* TO 'slash'@'%' identified by 'hoge';
-FLUSH PRIVILEGES;
-
-
-
+++ /dev/null
-#!/bin/bash
-set -eo pipefail
-
-# setting when first time
-
-function first_run() {
- if [ ! -f /var/lib/mysql/ibdata1 ]; then
- chown mysql:mysql /var/lib/mysql
- echo 'install db...'
- mysql_install_db --user=mysql
- fi
-
- FIRST_RUN=/var/lib/mysql/first-run.sql
- if [ ! -f ${FIRST_RUN}.done -a -f ${FIRST_RUN} ]; then
- echo 'run startup SQL...'
-
- /usr/sbin/mysqld --skip-networking &
- pid="$!"
-
- mysql=(mysql --protocol=socket -uroot)
- for i in {30..0}; do
- if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then
- break
- fi
- echo 'MySQL init process in progress...'
- sleep 1
- done
- if [ "$i" = 0 ]; then
- echo >&2 'MySQL init process failed.'
- return 1
- fi
-
- echo 'execute first-run.sql...'
- "${mysql[@]}" < ${FIRST_RUN}
- if [ "$?" = "1" ]; then
- echo >&2 'first-run.sql failed.'
- return 1
- fi
-
- mv -f ${FIRST_RUN} ${FIRST_RUN}.done
-
- echo "kill MySQL init process ($pid) ..."
- if ! kill -s TERM "$pid" || ! wait "$pid"; then
- echo >&2 'MySQL init process failed.'
- return 1
- fi
-
- echo 'startup done.'
- fi
- return 0
-}
-
-first_run
-if [ "$?" = "1" ]; then
- if [ "$1" = '/bin/bash' ]; then
- /bin/bash
- else
- exit 1
- fi
-
-fi
-
-if [ "$1" = 'mysqld' ]; then
- /usr/bin/mysqld_safe
-else
- exec "$@"
-fi
-
-
+++ /dev/null
-[client]
-default-character-set = utf8mb4
-
-[mysqld_safe]
-nice = -10
-timezone = GMT
-open-files-limit = 65536
-
-[mysqld]
-bind-address = 0.0.0.0
-tmpdir = /var/tmp
-
-# Backword compatibility to avoid 'BIGINT UNSIGNED value is out of range' error
-sql_mode = NO_UNSIGNED_SUBTRACTION
-
-# MyISAM settings (saving precious memory)
-#key_buffer_size = 512K
-#read_buffer_size = 128K
-#read_rnd_buffer_size = 128K
-#myisam_sort_buffer_size = 128K
-
-max_allowed_packet = 32M
-thread_stack = 192K
-join_buffer_size = 12M
-max_tmp_tables = 128
-tmp_table_size = 128M
-table_cache = 1200
-table_open_cache = 3072
-thread_cache_size = 32
-sort_buffer_size = 12M
-binlog_cache_size = 8M
-max_heap_table_size = 128M
-max_connections = 1200
-query_cache_limit = 2M
-query_cache_size = 64M
-query_cache_type = 1
-slow-query-log = 1
-slow-query-log-file = /var/log/mysql/mysql-slow.log
-long_query_time = 1
-server-id = 10
-log_bin = /var/log/mysql/mysql-bin.log
-max_binlog_size = 128M
-expire_logs_days = 10
-character-set-server = utf8mb4
-init-connect = SET NAMES utf8mb4;
-
-# InnoDB config
-innodb_file_format = Barracuda
-innodb_large_prefix
-# See http://dev.mysql.com/doc/refman/5.1/ja/innodb-configuration.html
-innodb_file_per_table
-# Set buffer pool size to 50-80% of your computer's memory,
-# but make sure on Linux x86 total memory usage is < 2GB
-#innodb_buffer_pool_size = 24G
-#innodb_additional_mem_pool_size = 40M
-# number of CPU cores dedicated to the MySQL InnoDB backend
-#innodb_buffer_pool_instances = 24
-#innodb_buffer_pool_instances = 16
-# Set the log file size to about 25% of the buffer pool size
-#innodb_log_file_size = 1G
-#innodb_log_buffer_size = 64M
-
-innodb_flush_method = O_DIRECT
-#innodb_flush_neighbors = 0 # From 5.6
-innodb_io_capacity = 2000
-#innodb_io_capacity_max = 4000 # From 5.6
-
-
-# long timeout for sphinx indexer
-net_write_timeout = 3600
-wait_timeout = 3600
-
-[mysqldump]
-default-character-set = binary
-max_allowed_packet = 512M
-
-[mysql]
-default-character-set = utf8mb4
+++ /dev/null
-[client]
-default-character-set = utf8mb4
-
-[mysqld_safe]
-nice = -10
-timezone = GMT
-open-files-limit = 65536
-
-[mysqld]
-bind-address = 0.0.0.0
-tmpdir = /var/tmp
-
-# Backword compatibility to avoid 'BIGINT UNSIGNED value is out of range' error
-sql_mode = NO_UNSIGNED_SUBTRACTION
-
-# MyISAM settings (saving precious memory)
-#key_buffer_size = 512K
-#read_buffer_size = 128K
-#read_rnd_buffer_size = 128K
-#myisam_sort_buffer_size = 128K
-
-max_allowed_packet = 32M
-thread_stack = 192K
-join_buffer_size = 12M
-max_tmp_tables = 128
-tmp_table_size = 128M
-table_cache = 1200
-table_open_cache = 3072
-thread_cache_size = 32
-sort_buffer_size = 12M
-binlog_cache_size = 8M
-max_heap_table_size = 128M
-max_connections = 1200
-query_cache_limit = 2M
-query_cache_size = 64M
-query_cache_type = 1
-slow-query-log = 1
-slow-query-log-file = /var/log/mysql/mysql-slow.log
-long_query_time = 1
-server-id = 10
-log_bin = /var/log/mysql/mysql-bin.log
-max_binlog_size = 128M
-expire_logs_days = 10
-character-set-server = utf8mb4
-init-connect = SET NAMES utf8mb4;
-
-# InnoDB config
-innodb_file_format = Barracuda
-innodb_large_prefix
-# See http://dev.mysql.com/doc/refman/5.1/ja/innodb-configuration.html
-innodb_file_per_table
-# Set buffer pool size to 50-80% of your computer's memory,
-# but make sure on Linux x86 total memory usage is < 2GB
-innodb_buffer_pool_size = 24G
-innodb_additional_mem_pool_size = 40M
-# number of CPU cores dedicated to the MySQL InnoDB backend
-innodb_buffer_pool_instances = 24
-#innodb_buffer_pool_instances = 16
-# Set the log file size to about 25% of the buffer pool size
-innodb_log_file_size = 1G
-innodb_log_buffer_size = 64M
-
-innodb_flush_method = O_DIRECT
-#innodb_flush_neighbors = 0 # From 5.6
-innodb_io_capacity = 2000
-#innodb_io_capacity_max = 4000 # From 5.6
-
-
-# long timeout for sphinx indexer
-net_write_timeout = 3600
-wait_timeout = 3600
-
-[mysqldump]
-default-character-set = binary
-max_allowed_packet = 512M
-
-[mysql]
-default-character-set = utf8mb4