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

dockerfile_lamp

时间:2020-04-04 16:14:41      阅读:95      评论:0      收藏:0      [点我收藏+]

标签:yum   bin   pen   flush   docker   dock   echo   database   openssh   

# centos7SSHDv1.0
FROM centos:7

RUN yum install -y lftp wget

RUN mv /etc/yum.repos.d/*.repo /tmp 
&& echo -e "[ftp]\nname=ftpbase\nbaseurl=ftp://172.17.0.1/pub\nenabled=1\ngpgcheck=0\n">/etc/yum.repos.d/ftp.repo RUN wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm && rpm -ivh mysql-community-release-el7-5.noarch.rpm RUN yum install -y vim net-tools openssh-server* httpd php php-mysql wget mysql-server mysql ADD init.sh / ADD Discuz.tar.gz /var/www/ RUN chmod 777 -R /var/www/html RUN chmod +x /init.sh &&sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config &&sed -i "s/#UseDNS.*/UseDNS no/g" /etc/ssh/sshd_config &&sed -i "s/GSSAPIAuthentication.*/GSSAPIAuthentication no/g" /etc/ssh/sshd_config &&echo 【xxxx】 |passwd root --stdin RUN sed -i "s/AddDefaultCharset UTF-8/AddDefaultCharset GB2312/g" /etc/httpd/conf/httpd.conf RUN systemctl enable sshd mysqld httpd CMD ["/usr/sbin/init","/init.sh"] EXPOSE 22 EXPOSE 3306 EXPOSE 80
[root@test2 CentOSLAMP]# cat init.sh 
#!/bin/bash
systemctl restart mysqld
mysql -e "GRANT ALL  ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘123qwe‘;GRANT ALL  ON *.* TO ‘root‘@‘localhost‘ IDENTIFIED BY ‘123qwe‘;delete from mysql.user where user = ‘‘;delete from mysql.user where password=‘‘;create database d;GRANT ALL  ON d.* TO ‘d‘@‘%‘ IDENTIFIED BY ‘123456‘;flush privileges;"

 

dockerfile_lamp

标签:yum   bin   pen   flush   docker   dock   echo   database   openssh   

原文地址:https://www.cnblogs.com/Leaders543/p/12632215.html

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