-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b0e90e
commit 8365ac0
Showing
4 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |