阅读量: 118
Docker的基本组成Docker镜像就好比是一个模板,可以通过这个模板来创建容器服务,通过这种技术可以创建多个容器(最终服务运行或者项目运行就是在容器中的)。
二、容器(container)Docker利用容器技术,独立运行一个或者一个组应用,通过镜像来创建的。其中:“启动、停止、删除、暂停”为基本的命令!
三、仓库(repository)仓库就是存放镜像的地方!
仓库分为公有仓库和私有仓库
Docker Hub默认是国外的!
Docker安装一、准备工作需要会一点点的Linux基础命令Linux系统(Centos或Ubuntu),笔者这里推荐使用的Ubuntu二、步骤如下1、卸载旧的版本代码语言:javascript代码运行次数:0运行复制$ sudo apt-get remove docker docker-engine docker.io containerd runc
$ sudo apt-get update
安装 apt 依赖包,用于通过HTTPS来获取仓库:
代码语言:javascript代码运行次数:0运行复制$ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
$ sudo add-apt-repository \ "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ \ $(lsb_release -cs) \ stable"$ sudo apt-get update$ sudo apt-get install docker-ce docker-ce-cli containerd.io
$ sudo docker run hello-world
更多详细,请参考帮助文档:https://docs.docker.com/engine/install/
了解如何卸载Docker代码语言:javascript代码运行次数:0运行复制// 1、卸载软件包$ sudo apt-get remove docker docker-engine docker.io containerd runc// 2、删除资源(这个是docker的默认工作路径)$ sudo rm-rf /var/lib/docker
由于访问的镜像都是在国外,我们这里可以设置一些国内加速服务:
Docker中国区官方镜像https://registry.docker-cn.com网易http://hub-mirror.c.163.comustchttps://docker.mirrors.ustc.edu.cn中国科技大学https://docker.mirrors.ustc.edu.cn首页点击“创建我的容器镜像” 得到一个专属的镜像加速地址,类似于“https://1234abcd.mirror.aliyuncs.com”一、配置方式1、文件配置添加”https://registry.docker-cn.com” 到 registry-mirrors 数组
代码语言:javascript代码运行次数:0运行复制$ sudo vim /etc/docker/daemon.json { "registry-mirrors": ["https://registry.docker-cn.com"]}$ sudo systemctl restart docker.service
$ sudo dockerd --registry-mirror=https://registry.docker-cn.com
以上就是Docker安装的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号