docker 新容器修改

1.下载 镜像文件

2.导入到 docker 上

3.ssh 连接不上
首先安装sshd 服务: yum -y install *ssh*
修改 ssh 配置文件:vim /etc/ssh/sshd_config

UsePAM no

PermitRootLogin yes

启动 ssh 服务:service sshd start

开机自启动: chkconfig --add sshd     chkconfig sshd on


注:不需要安装 sshd 服务也可以,全都通过 映射的形式,将你需要的东西都放在 宿主机上

如: 需要安装的软件 docker run -itd -v /user/src/soft/:/usr/src/soft/ --net=none --name=soft_test centos /bin/bash


4.安装 passwd

yum -y install passwd

passwd 运行设置密码


5.安装 vim vi

yum -y install vi vim


6.安装 net-tool ,wget

yum -y install net-tools.x86_64  (通过yum search ifconfig)

yum -y install wget


7.修改 镜像bash-4.1#

# vim ~/.bash_profile


# .bash_profile 

# Get the aliases and functions 

if [ -f ~/.bashrc ]; then 

        . ~/.bashrc 

fi


# vim ~/.bashrc

# .bashrc 

# Source global definitions 

if [ -f /etc/bashrc ]; then

         . /etc/bashrc

fi 

# User specific aliases and functions


source ~/.bash_profile; source ~/.bashrc


8.rsyslog 服务安装

yum -y install rsyslog

chkconfig --add rsyslog

chkconfig rsyslog on


9.碰到这种警告的时候,需要修改 docker 启动脚本配置

[WARNING] 082/032015 (572) : [/usr/local/haproxy/sbin/haproxy.main()] Cannot raise FD limit to 131088.

[WARNING] 082/032015 (572) : [/usr/local/haproxy/sbin/haproxy.main()] FD limit (1024) too low for maxconn=65535/maxsock=131088. Please raise 'ulimit-n' to 131088 or more to avoid any trouble.

解决:sudo sh -c 'printf "\nulimit -HSn 999999\n" >> /etc/sysconfig/docker'

sudo service docker restart


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值