docker安装

来源:互联网 发布:老巴黎西洋家具淘宝网 编辑:程序博客网 时间:2024/04/30 05:35

安装

安装步骤:https://docs.docker.com/linux/step_one/
https://docs.docker.com/engine/installation/linux/ubuntu/
官网推荐的安装步骤已经很详细了,这里只是总结下安装过程遇到的坑

1. 首先需要升级内核版本

因为我用的是阿里云的服务器 内核版本比较低,Docker需要在3.8以上运行            查看系统版本命令 uname -a 或者uname -r
docker 升级内核的步骤:https://docs.docker.com/engine/installation/linux/ubuntulinux/

升级内核命令:

 install the backported kernel  $ sudo apt-get update  $ sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring  # install the backported kernel and xorg if using Unity/Xorg  $ sudo apt-get install --install-recommends linux-generic-lts-raring xserver-xorg-lts-raring libgl1-mesa-glx-lts-raring  # reboot  $ sudo reboot 

这部分参考博客:http://blog.csdn.net/minimicall/article/details/40108305

2.执行官网的安装脚本

$ curl -fsSL https://get.docker.com/ | sh

3.docker启动与验证

改路由表

sudo route del -net 172.16.0.0 netmask 255.240.0.0

启动命令:

sudo service docker start

docker的信息命令

root@master:~# docker infoContainers: 0 Running: 0 Paused: 0 Stopped: 0Images: 0Server Version: 1.10.2Storage Driver: aufs Root Dir: /var/lib/docker/aufs Backing Filesystem: extfs Dirs: 0 Dirperm1 Supported: falseExecution Driver: native-0.2Logging Driver: json-filePlugins:  Volume: local Network: bridge null hostKernel Version: 3.8.0-44-genericOperating System: Ubuntu precise (12.04.5 LTS)OSType: linuxArchitecture: x86_64CPUs: 1Total Memory: 993.3 MiBName: masterID: C7PX:OJOD:OEPO:6KA6:WVSH:ULWE:5GOD:EBDZ:EU6A:YHGS:6LL2:ZJAMroot@master:~# Last login: Tue Feb 23 09:31:21 2016 from 101.231.165.18root@master:~# docker infoContainers: 0 Running: 0 Paused: 0 Stopped: 0Images: 0Server Version: 1.10.2Storage Driver: aufs Root Dir: /var/lib/docker/aufs Backing Filesystem: extfs Dirs: 0 Dirperm1 Supported: falseExecution Driver: native-0.2Logging Driver: json-filePlugins:  Volume: local Network: null host bridgeKernel Version: 3.8.0-44-genericOperating System: Ubuntu precise (12.04.5 LTS)OSType: linuxArchitecture: x86_64CPUs: 1Total Memory: 993.3 MiBName: masterID: C7PX:OJOD:OEPO:6KA6:WVSH:ULWE:5GOD:EBDZ:EU6A:YHGS:6LL2:ZJAM

测试hellow-world:docker run hello-world

root@master:~# docker run hello-worldUnable to find image 'hello-world:latest' locallylatest: Pulling from library/hello-world03f4658f8b78: Pull complete a3ed95caeb02: Pull complete Digest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7Status: Downloaded newer image for hello-world:latestHello from Docker.This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from that image which runs the    executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it    to your terminal.To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker Hub account: https://hub.docker.comFor more examples and ideas, visit: https://docs.docker.com/userguide/
0 0
原创粉丝点击