码迷,mamicode.com
首页 > 其他好文 > 详细

centos7 ssh dockerfile

时间:2020-03-15 11:46:34      阅读:75      评论:0      收藏:0      [点我收藏+]

标签:run   net   under   evel   dock   ica   groupadd   dev   col   

 

 

centos7 ssh  dockerfile

FROM centos:centos7.7.1908
RUN yum  -y install wget 
RUN rm -rf /etc/yum.repos.d/* 
RUN cd /etc/yum.repos.d/ \ 
    && wget http://mirrors.aliyun.com/repo/Centos-7.repo      && wget http://mirrors.aliyun.com/repo/epel-7.repo
RUN yum clean all
RUN yum install -y openssh-server bind-utils sysstat telnet net-tools glibc-common gcc automake autoconf libtool make  gcc-c++ unzip libaio-devel numactl vim openssh*

RUN sed -i ‘s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g‘ /etc/ssh/sshd_config
RUN sed -i ‘s/#UseDNS yes/UseDNS no/g‘ /etc/ssh/sshd_config

RUN echo ‘123456‘ | passwd --stdin root
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key  
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key  


COPY mysql /usr/local/mysql
ADD my.cnf /etc/

RUN mkdir -p /data/mysql/mysql3306/{data,logs,temp}     && groupadd mysql     && useradd -g mysql -s /sbin/nologin  -d /usr/local/mysql -MN mysql     && echo "PATH=$PATH:/usr/local/mysql/bin/" >>/etc/profile     && chown -R mysql.mysql /data/mysql

RUn chown -R mysql.mysql /usr/local/mysql

# ------------------------------------------------------------------------------
ADD localtime /etc/localtime 

RUN mkdir /var/run/sshd  
EXPOSE 22  
CMD ["/usr/sbin/sshd", "-D"]

 

centos7 ssh dockerfile

标签:run   net   under   evel   dock   ica   groupadd   dev   col   

原文地址:https://www.cnblogs.com/fengjian2016/p/12496438.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!