29 lines
660 B
Markdown
29 lines
660 B
Markdown
# centos sshd 搭建
|
||
## 创建镜像
|
||
镜像构建源码请[参考](http://git.yangyufans.com/pub/docker/tree/master/sshd/centos)
|
||
|
||
进入相应的sshd版本,执行以下命令
|
||
```bash
|
||
docker build -t ccr.ccs.tencentyun.com/yy-dk/centos-sshd:7.0 .
|
||
```
|
||
## 从远程仓库下载
|
||
|
||
```bash
|
||
docker pull ccr.ccs.tencentyun.com/yy-dk/centos-sshd:7.0
|
||
```
|
||
## 创建网络
|
||
```bash
|
||
docker network create -d bridge --subnet 172.10.0.0/24 --gateway 172.10.0.1 my_net
|
||
```
|
||
## 启动容器
|
||
```bash
|
||
docker run -d \
|
||
--network my_net \
|
||
--ip 172.10.0.4 \
|
||
--name centos-sshd \
|
||
ccr.ccs.tencentyun.com/yy-dk/centos-sshd:7.0
|
||
```
|
||
|
||
> 用户名:root
|
||
|
||
> 密码:123456 |