diff --git a/debian/jessie/Dockerfile b/debian/jessie/Dockerfile new file mode 100644 index 0000000..19ca13e --- /dev/null +++ b/debian/jessie/Dockerfile @@ -0,0 +1,43 @@ +FROM debian:jessie +LABEL maintainer="TwinDB Development Team " +EXPOSE 22 +EXPOSE 3306 + +# Install packages +RUN \ + apt-get update; \ + apt-get -y install curl lsb-release wget netcat sudo \ + openssh-client openssh-server + +# Install Oracle Repo +RUN mysql_repo=mysql-apt-config_0.8.9-1_all.deb ; \ + curl --location https://dev.mysql.com/get/${mysql_repo} > /tmp/${mysql_repo} ; \ + DEBIAN_FRONTEND=noninteractive dpkg -i /tmp/${mysql_repo} ; \ + apt-get update + + +# Install/start sshd +RUN \ + mkdir /var/run/sshd ; \ + mkdir -p /root/.ssh/ ; \ + /bin/chown root:root /root/.ssh ; \ + /bin/chmod 700 /root/.ssh/ ; \ + /usr/sbin/sshd + +COPY id_rsa.pub /root/.ssh/authorized_keys +RUN \ + /bin/chmod 600 /root/.ssh/authorized_keys ; \ + /bin/chown root:root /root/.ssh/authorized_keys + +# Install/start MySQL +RUN mkdir -p /etc/mysql +ADD my-master-legacy.cnf /etc/mysql/my.cnf + +RUN DEBIAN_FRONTEND=noninteractive \ + apt-get -y install mysql-community-server mysql-community-client + +COPY docker-entrypoint.sh /usr/local/bin/ +RUN /bin/chmod 755 /usr/local/bin/docker-entrypoint.sh +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + +CMD ["mysqld", "--user=root"] diff --git a/debian/jessie/docker-entrypoint.sh b/debian/jessie/docker-entrypoint.sh new file mode 100644 index 0000000..9a97e1e --- /dev/null +++ b/debian/jessie/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +DATADIR="/var/lib/mysql" + +rm -rf ${DATADIR} +mkdir -p ${DATADIR} + +mysqld --initialize-insecure --user=root +/bin/chown -R mysql:mysql "${DATADIR}" /var/run/mysqld +/bin/chown 777 /var/run/mysqld + +exec mysqld --user=root \ No newline at end of file diff --git a/debian/jessie/id_rsa.pub b/debian/jessie/id_rsa.pub new file mode 100644 index 0000000..f9e3b80 --- /dev/null +++ b/debian/jessie/id_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyXxAjPShNGAedbaEtltFI6A7RlsyI+4evxTq6uQrgbJ6Hm+pHBXshXQYXDyVjvytaM+6GKF+r+6+C+6Wc5Xz4lLO/ZiSCdPbyEgqw1JoHrgPNpc6wmCtjJExxjzvpwSVgbZg3xOdqW1y+TyqeUkXEg/Lm4VZhN1Q/KyGCgBlWuAXoOYRGhaNWqcnr/Wn5YzVHAx2yJNrurtKLVYVMIkGcN/6OUaPpWqKZLaXiK/28PSZ5GdTDmxRg4W0pdyGEYQndpPlpLF4w5gNUEhVZM8hWVE29+DIW3XXVYGYchxmkhU7wrGxxZR+k5AT+7g8VspVS8zNMXM9Z27w55EQuluNMQ== root@testdriver.box \ No newline at end of file diff --git a/debian/jessie/my-master-legacy.cnf b/debian/jessie/my-master-legacy.cnf new file mode 100644 index 0000000..bebbf2b --- /dev/null +++ b/debian/jessie/my-master-legacy.cnf @@ -0,0 +1,14 @@ +[mysqld] +user=root +datadir=/var/lib/mysql +socket=/var/lib/mysql/mysql.sock +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 + +server_id=100 +log-bin=mysql-bin +log-slave-updates + +[mysqld_safe] +log-error=/var/log/mysqld.log +pid-file=/var/run/mysqld/mysqld.pid