linux上下载镜像及进入到镜像中
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
免费下载资源
·
1.linux上 下载镜像:docker run -it centos:7 sleep 1000000
2.先列出运行中的容器: docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9c360ee30424 centos:7 "sleep 1000000" 27 minutes ago Up 27 minutes gracious_kowalevski
5960e9291963 nginx "nginx -g 'daemon of…" 21 hours ago Up 21 hours 0.0.0.0:9100->80/tc
3.docker inspect 命令 :该命令用于获取容器/镜像的元数据
docker inspect 9c3
4.把docker文件拷贝到镜像文件目录里面
docker cp ./dcos_generate_config.sh 9c3:/root/
docker cp ./genconf 9c3:/root/
查看9c3镜像/root目录下的文件列表
docker exec -it 9c3 ls /root
5.进入docker镜像命令: docker exec -it 镜像Id或镜像name /bin/bash
例: docker exec -it 9c3 /bin/bash
6.ssh登录143
[root@9c360ee30424 genconf]#ssh -i ssh-key 10.3.65.143
bash: ssh: command not found
[root@9c360ee30424 genconf]# yum list installed | grep sshd
[root@9c360ee30424 genconf]# yum install -y sshd
2.先列出运行中的容器: docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9c360ee30424 centos:7 "sleep 1000000" 27 minutes ago Up 27 minutes gracious_kowalevski
5960e9291963 nginx "nginx -g 'daemon of…" 21 hours ago Up 21 hours 0.0.0.0:9100->80/tc
3.docker inspect 命令 :该命令用于获取容器/镜像的元数据
docker inspect 9c3
4.把docker文件拷贝到镜像文件目录里面
docker cp ./dcos_generate_config.sh 9c3:/root/
docker cp ./genconf 9c3:/root/
查看9c3镜像/root目录下的文件列表
docker exec -it 9c3 ls /root
5.进入docker镜像命令: docker exec -it 镜像Id或镜像name /bin/bash
例: docker exec -it 9c3 /bin/bash
6.ssh登录143
[root@9c360ee30424 genconf]#ssh -i ssh-key 10.3.65.143
bash: ssh: command not found
[root@9c360ee30424 genconf]# yum list installed | grep sshd
[root@9c360ee30424 genconf]# yum install -y sshd
GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
已为社区贡献1条内容
所有评论(0)