Dockerfile (2124B)
1 FROM debian:jessie 2 RUN apt-get update && apt-get install -y git \ 3 make \ 4 build-essential \ 5 autoconf \ 6 libtool \ 7 lib32z1-dev \ 8 dbus 9 10 RUN apt-get update && apt-get install -y perl pwgen --no-install-recommends && rm -rf /var/lib/apt/lists/* 11 12 # gpg: key 5072E1F5: public key "MySQL Release Engineering <mysql-build@oss.oracle.com>" imported 13 RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5 14 15 ENV MYSQL_MAJOR 5.7 16 ENV MYSQL_VERSION 5.7.13-1debian8 17 18 RUN echo "deb http://repo.mysql.com/apt/debian/ jessie mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list 19 20 # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) 21 # also, we set debconf keys to make APT a little quieter 22 RUN { \ 23 echo mysql-community-server mysql-community-server/data-dir select ''; \ 24 echo mysql-community-server mysql-community-server/root-pass password ''; \ 25 echo mysql-community-server mysql-community-server/re-root-pass password ''; \ 26 echo mysql-community-server mysql-community-server/remove-test-db select false; \ 27 } | debconf-set-selections \ 28 && apt-get update && apt-get install -y mysql-server="${MYSQL_VERSION}" libmysqlclient-dev && rm -rf /var/lib/apt/lists/* \ 29 && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \ 30 && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ 31 # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime 32 && chmod 777 /var/run/mysqld 33 34 RUN git clone https://github.com/akopytov/sysbench.git && cd sysbench && ./autogen.sh && ./configure && make && make install 35 RUN mkdir -p /root/shared/results/ && touch /root/shared/results/benchmark.txt 36 RUN service dbus start 37 #CMD ["/bin/bash", "sysbench --debug > /root/shared/results/benchmark.txt"]