网站源代码怎么放入 dede网站后台,成品网站 免费,五金设备网站建设,成都游戏外包公司排名Docker 是一个开源工具#xff0c;它可以让创建和管理 Linux 容器变得简单。容器就像是轻量级的虚拟机#xff0c;并且可以以毫秒级的速度来启动或停止。Docker 帮助系统管理员和程序员在容器中开发应用程序#xff0c;并且可以扩展到成千上万的节点。 容器和 VM#xff08… Docker 是一个开源工具它可以让创建和管理 Linux 容器变得简单。容器就像是轻量级的虚拟机并且可以以毫秒级的速度来启动或停止。Docker 帮助系统管理员和程序员在容器中开发应用程序并且可以扩展到成千上万的节点。 容器和 VM虚拟机的主要区别是容器提供了基于进程的隔离而虚拟机提供了资源的完全隔离。虚拟机可能需要一分钟来启动而容器只需要一秒钟或更短。容器使用宿主操作系统的内核而虚拟机使用独立的内核。 Docker 的局限性之一是它只能用在 64 位的操作系统上。 在这篇文章中我们将讨论如何在 CentOS 7.x 中安装 docker。 CentOS 6/7系列安装Docker http://www.linuxidc.com/Linux/2014-07/104768.htm Docker的搭建Gitlab CI 全过程详解 http://www.linuxidc.com/Linux/2013-12/93537.htm Docker安装应用(CentOS 6.5_x64) http://www.linuxidc.com/Linux/2014-07/104595.htm 在 Docker 中使用 MySQL http://www.linuxidc.com/Linux/2014-01/95354.htm 在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker http://www.linuxidc.com/Linux/2014-10/108184.htm Docker安装应用(CentOS 6.5_x64) http://www.linuxidc.com/Linux/2014-07/104595.htm Ubuntu 14.04安装Docker http://www.linuxidc.com/linux/2014-08/105656.htm 阿里云CentOS 6.5 模板上安装 Docker http://www.linuxidc.com/Linux/2014-11/109107.htm CentOS 7 中 Docker 的安装 Docker 软件包已经包括在默认的 CentOS-Extras 软件源里。因此想要安装 docker只需要运行下面的 yum 命令
[rootlocalhost ~]# yum install docker 启动 Docker 服务 安装完成后使用下面的命令来启动 docker 服务并将其设置为开机启动
[rootlocalhost ~]# service docker start[rootlocalhost ~]# chkconfig docker on LCTT 译注此处采用了旧式的 sysv 语法如采用CentOS 7中支持的新式 systemd 语法如下
[rootlocalhost ~]# systemctl start docker.service[rootlocalhost ~]# systemctl enable docker.service 下载官方的 CentOS 镜像到本地 LCTT 译注由于 Docker 被墙 :- 所以请使用 http://docker.cn 的镜像感谢马全一 的镜像。
[rootlocalhost ~]# docker pull centosPulling repository centos192178b11d36:Download complete70441cac1ed5:Download completeae0c2d0bdc10:Download complete511136ea3c5a:Download complete5b12ef8fd570:Download complete 确认 CentOS 镜像已经被获取
[rootlocalhost ~]# docker images centosREPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZEcentos centos5 192178b11d362 weeks ago 466.9 MBcentos centos6 70441cac1ed52 weeks ago 215.8 MBcentos centos7 ae0c2d0bdc10 2 weeks ago 224 MBcentos latest ae0c2d0bdc10 2 weeks ago 224 MB 运行一个 Docker 容器
[rootlocalhost ~]# docker run -i -t centos /bin/bash[rootdbf66395436d /]# 我们可以看到CentOS 容器已经被启动并且我们得到了 bash 提示符。在 docker 命令中我们使用了 “-i 捕获标准输入输出”和 “-t 分配一个终端或控制台”选项。若要断开与容器的连接输入 exit。
[rootcd05639b3f5c /]# cat /etc/RedHat-releaseCentOSLinux release 7.0.1406(Core)[rootcd05639b3f5c /]#exitexit[rootlocalhost ~]# 我们还可以搜索基于 Fedora 和 Ubuntu 操作系统的容器。
[rootlocalhost ~]# docker search ubuntu[rootlocalhost ~]# docker search fedora 显示当前正在运行容器的列表