centos7 ssh dockerfile
Posted fengjian2016
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7 ssh dockerfile相关的知识,希望对你有一定的参考价值。
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的主要内容,如果未能解决你的问题,请参考以下文章
在Docker中使用Dockerfile实现ISO文件转化为完整版Centos镜像,并搭建集群数据仓库