FROM mysql:5.6.37
MAINTAINER kalvin "dekun.dai@quantgroup.cn"

# #替换源
WORKDIR /etc/apt/
RUN mv sources.list /tmp

RUN echo deb http://mirrors.163.com/debian/  stretch main non-free contrib >> sources.list \
    && echo deb http://mirrors.163.com/debian/  stretch-updates main non-free contrib >> sources.list \
    && echo deb http://mirrors.163.com/debian/  stretch-backports main non-free contrib >> sources.list \
    && echo deb-src http://mirrors.163.com/debian/  stretch main non-free contrib >> sources.list \
    && echo deb-src http://mirrors.163.com/debian/  stretch-updates main non-free contrib >> sources.list \
    && echo deb-src http://mirrors.163.com/debian/  stretch-backports main non-free contrib >> sources.list \
    && echo deb http://mirrors.163.com/debian-security/  stretch/updates main non-free contrib >> sources.list \
    && echo deb-src http://mirrors.163.com/debian-security/  stretch/updates main non-free contrib >> sources.list

#安装必要工具
RUN apt-get update \
		&& apt-get install -y vim \
		&& apt-get install -y telnet \
		&& apt-get install -y openssh-server \
		&& /etc/init.d/ssh start

WORKDIR /home/quant_group/mysql
RUN mkdir sql_to_run
COPY ./sql_to_run/*  ./sql_to_run
COPY docker-entrypoint.sh .
COPY db_execute_sql.sh .

RUN chmod +x ./docker-entrypoint.sh

CMD ["./docker-entrypoint.sh"]