千家信息网

将镜像导入docker

发表于:2025-02-03 作者:千家信息网编辑
千家信息网最后更新 2025年02月03日,docker镜像都在:https://hub.docker.com/将镜像导入到docker:[root@localhost ~]# docker load < httpd.tar从网上下载busyb
千家信息网最后更新 2025年02月03日将镜像导入docker

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

0