Skip to content

Commit

Permalink
add debian jessie image
Browse files Browse the repository at this point in the history
  • Loading branch information
akuzminsky committed Feb 26, 2018
1 parent 6b0e90e commit 8365ac0
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
43 changes: 43 additions & 0 deletions debian/jessie/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM debian:jessie
LABEL maintainer="TwinDB Development Team <[email protected]>"
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"]
11 changes: 11 additions & 0 deletions debian/jessie/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions debian/jessie/id_rsa.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyXxAjPShNGAedbaEtltFI6A7RlsyI+4evxTq6uQrgbJ6Hm+pHBXshXQYXDyVjvytaM+6GKF+r+6+C+6Wc5Xz4lLO/ZiSCdPbyEgqw1JoHrgPNpc6wmCtjJExxjzvpwSVgbZg3xOdqW1y+TyqeUkXEg/Lm4VZhN1Q/KyGCgBlWuAXoOYRGhaNWqcnr/Wn5YzVHAx2yJNrurtKLVYVMIkGcN/6OUaPpWqKZLaXiK/28PSZ5GdTDmxRg4W0pdyGEYQndpPlpLF4w5gNUEhVZM8hWVE29+DIW3XXVYGYchxmkhU7wrGxxZR+k5AT+7g8VspVS8zNMXM9Z27w55EQuluNMQ== [email protected]
14 changes: 14 additions & 0 deletions debian/jessie/my-master-legacy.cnf
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8365ac0

Please sign in to comment.