将镜像导入docker

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

将镜像导入到docker:sql

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

从网上下载busybox:windows

[root@localhost ~]# docker pull busyboxtcp

查看加速器:ide

[root@localhost ~]# docker infoget

将镜像httpd导出并更名为httpd-new.tarit

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

将镜像下载到windowstest

[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

相关文章
相关标签/搜索