启动一个centos服务
[email protected]:/data# docker run --privileged -itd --name centos_lnmp1.14 -p 8088:80 -p 33006:3306 centos /usr/sbin/init
[email protected]:/data# docker exec -it 97aaee886614 /bin/bash
[[email protected] /]#yum install -y gcc-c++ gcc openssl openssl-devel pcre-devel pcre openssh opsnssh-devel opsnssh-server openssh-* wget curl net-tools make sed
[[email protected] /]# sed -i ‘[email protected]#Port [email protected] [email protected]‘ /etc/ssh/sshd_config
我的此处的sshd默认是开启服务的 重新启动是不可以启动的需要手动kill掉sshd服务
[[email protected] /]# ss -tunlp |awk -F‘,‘ ‘{print $2}‘|awk -F"=" ‘{print $2}‘
[[email protected] /]# kill -p pid
[email protected] /]# systemctl restart sshd
docker 中 centos /etc/rc.d/init.d/functions: No such file or directory 错误,解决
[[email protected] /]#rpm -qf /etc/init.d/functions
[[email protected] /]#yum install -y initscripts
原文地址:http://blog.51cto.com/9025736/2332867
时间: 2024-10-28 21:56:14