docker源码安装_docker必装镜像方法

docker源码安装_docker必装镜像方法,第1张

docker源码安装_docker必装镜像方法 1、前言Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级、可移植的容器中,然后发布到任何流行的 Linux 机器上,实现虚拟化。

容器是完全使用沙箱机制,相互之间不会有任何接口,更重要的是容器性能开销极低。

2、安装sudo apt-get update安装依赖包sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common添加 Docker 的官方 GPG 密钥curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -设置稳定版仓库sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable"add-apt-repository "deb https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable"更新软件库sudo apt-get update安装最新的Docker-cesudo apt-get install docker-ce启动sudo service docker start增加Docker的镜像源配置文件 vi /etc/docker/daemon.json,如果没有配置过镜像该文件默认是不存的,在其中增加如下内容:{ “registry-mirrors”: [“https://y0qd3iq.mirror.aliyuncs.com”] }其中的URL就是指定的镜像源,可自行修改任何国内站点然后重启Docker服务:service docker restart然后通过以下命令查看配置是否生效:docker info|grep Mirrors -A 1可以看到如下的输出:Registry Mirrors: https://y0qd3iq.mirror.aliyuncs.com/就表示镜像配置成功,然后再执行docker pull *** 作,就会很快了。

1)开机启动systemctl enable docker.service2)拉取镜像docker pull scrapinghub/splash3)启动镜像服务docker run -p 8050:8050 scrapinghub/splash4)镜像开机自启动docker run –restart=always -p 8050:8050 scrapinghub/splash5)常用命令docker images 查看已有镜像docker ps 查看运行镜像docker rmi -f 镜像名 强制删除镜像

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/646952.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-17
下一篇 2022-04-17

发表评论

登录后才能评论

评论列表(0条)

保存