docker安装

docker安装

Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。 —— [ 百度百科 ]

  • 测试环境
    ubuntu 14.04 server版本 64位系统1
  • 事先操作
    更新apt-get源
  vim /etc/apt/sources.list

将aliyun源写入该文件

 deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

deb http://mirrors.aliyuncs.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyuncs.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyuncs.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyuncs.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyuncs.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty-backports main restricted universe multiverse

然后执行命令,更新软件包 并备份文件

apt-get update 

cp /etc/apt/sources.list /mnt/source.list
curl -sSL https://get.daocloud.io/docker | sh

下面,我们就可以使用docker命令了,docker运行在后台的程序.

 service docker start|restart|stop|status 

只有在服务启动的时候才可以正常使用docker命令3,所以我们得出这个是一个C/S的程序,一个服务端 一个客户端交互运行。

  • Dockerfile4
    我这里简单说明sources.list5在Dockerfile怎么使用:
    将备份的sources.list备份到/mnt/ 目录下
    cd  /mnt 
    vim Dockerfile
      # VERSION 0.0.1
      # 默认ubuntu server长期支持版本,当前是12.04
      FROM ubuntu:latest
      # 签名啦
      MAINTAINER cuisongliu"cuisongliu@qq.com"
      #覆盖docker主机中的apt源
      ADD  sources.list  /etc/apt/sources.list
      # 更新源,安装ssh server 
      RUN apt-get update
    :wq
    docker build  -t  docker/aliyun

  1. docker支持的系统为64位系统,32位系统需要更多操作.
  2. https://dashboard.daocloud.io/runtimes/new 在这里注册帐号可以添加主机监控,更快的pull镜像.
  3. docker build|pull|push|kill|load|tag 等等命令,输入docker COMMAND –help即可查看
  4. http://blog.csdn.net/wsscy2004/article/details/25878223# 这里有具体说明.
  5. 这里更换docker主机里的源是因为,第一次build的时候会先从远程pull一次,如果没有国内源或者网络比较好的源地址的话会卡在build的时候.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值