温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

将镜像导入docker

发布时间:2020-07-24 11:12:05 来源:网络 阅读:105 作者:qq5bb2021f831d3 栏目:系统运维

docker镜像都在:https://hub.docker.com/

将镜像导入到docker:

[root@localhost ~]# docker load < httpd.tar

从网上下载busybox:

[root@localhost ~]# docker pull busybox

查看加速器:

[root@localhost ~]# docker info

将镜像httpd导出并改名为httpd-new.tar

[root@localhost ~]# docker save > httpd-new.tar httpd:latest

将镜像下载到windows

[root@localhost ~]# sz httpd-new.tar

防止混乱成对使用 后面加要导入/导出的镜像

[root@localhost ~]# docker save -o 导出

[root@localhost ~]# docker save -i 导入

[root@localhost ~]# docker save > 导出

[root@localhost ~]# docker save < 导入

根据一个镜像运行一个容器:

[root@localhost ~]# docker run -itd --name bdqn -p 90:80 httpd:latest

-i:可交互 -t:tty:用来模拟一个伪终端 -d:保持后台运行 --name:给容器起的名字

-p:端口

去掉-d:不让在后台运行会进入容器里面

查看docker容器里的服务端口:

[root@localhost ~]# docker ps

0.0.0.0:90->80/tcp:运行本机的90端口就等于运行容器的80端口

查找mysql可用的镜像:

[root@localhost ~]# docker search mysql

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI