(1).拉取镜像,镜像id:5e35e350aded
docker pull centos:7
(2).运行镜像生成容器,容器id:44597c6694a3
docker run -d -i -t -p 80:80 -p 21:21 -p 22:22 -p 23:23 -p 3306:3306 -p 6379:6379 -p 8888:8888 -p 9501:9501 -p 9502:9502 -v /d/wwwroot:/www --privileged 5e35e350aded /usr/sbin/init
(3).进入容器:
docker exec -it 44597c6694a3 /bin/bash
(4).容器中安装ssh
yum install -y openssh-server openssh-clients
(5).vi /etc/ssh/sshd_config开启允许root登录,取消前面的注释#
PermitRootLogin yes
(6).重启sshd服务
systemctl restart sshd
(7).上一步如果报错可执行(我的没有报错)
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
(8).设置root密码
passwd
(9).测试ssh连接
ssh -p22 root@localhost
(10).注意点:--privileged和/usr/sbin/init是允许你开启特权运行,否则无法执行systemctl
【一】.钩子文件的设置和创建(1).打开hooks目录,可以看到有一个post-commit.tmpl文件,这是一个模板文件。复制一份,重命名为post-commit,将其用户组设为www,并设置为可执行。chown www:www post-commitchmod +x post-commit(2...
1.全局用户信息设置 git config --global user.name gaojiufeng git config --global user.email 392223903...
Application 对象用于存储和访问来自任意页面的变量,类似 Session 对象。不同之处在于所有的用户分享一个 Application 对象,而 session 对象和用户的关系是一一对应的。很多的书籍中介绍的Application对象都喜欢以统计在线人数来介绍Application 对象...
1.远程仓库的协作模式开发者把自己最新的版本推到线上仓库,同时把线上仓库的最新代码,拉到自己本地即可2.注册git帐号国外: http://www.github.com国内: http://git.oschina.net2.在码云创建项目,不要初始化readmegit push https://gi...
日志查看:git log版本切换:方式1:git reset --hard HEAD^ 倒退一个版本git reset --hard HEAD^^ 倒退两个版本方式2:(版本号的形式,建议版本号码补充完...
1.关机Process.Start("shutdown", "-s -t 0"); 2. 注销 Proc...