前言
隨着docker的不斷升級,也提供更加豐富的功能,目前Centos6.x默認最新版本僅爲 Docker version 1.7.1, build 786b29d/1.7.1
該版本對於docker的監控功能少之極少,爲了方便通過zabbix監控docker服務的性能,以下將docker升級至 1.13.0版本
環境
操作系統 : centos 6.7
docker版本:Docker version 1.7.1, build 786b29d/1.7.1
docker升級目前版本:Docker version 1.13.0
相關依賴環境:yum install udev udev-devel device-mapper-libs
操作
一、卸載docker服務,卸載之前請將容器及數據進行備份
#> rpm -qa | grep docker
docker-io-1.7.1-2.el6.x86_64
#> rpm -e docker-io-1.7.1-2.el6.x86_64
二、上傳新版docker文件
文件下載地址:https://download.docker.com/linux/static/stable/x86_64/
將文件上傳服務器進行解壓
以下官方安裝說明
1、Download the static binary archive. Go to https://download.docker.com/linux/static/stable/ (or change stable to nightly or test), choose your hardware platform, and download the .tgz file relating to the version of Docker Engine - Community you want to install.
2、Extract the archive using the tar utility. The dockerd and docker binaries are extracted.
$ tar xvf /path/to/docker-1.13.0.tgz
3、Optional: Move the binaries to a directory on your executable path, such as /usr/bin/. If you skip this step, you must provide the path to the executable when you invoke docker or dockerd commands.
$ sudo cp docker/* /usr/bin/
4、Start the Docker daemon:
$ sudo dockerd &
If you need to start the daemon with additional options, modify the above command accordingly or create and edit the file /etc/docker/daemon.json to add the custom configuration options.
5、Verify that Docker is installed correctly by running the hello-world image.
$ sudo docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.
根據以上步驟即可完成操作。
常見問題:
[root@dev141 src]# INFO[0000] libcontainerd: new containerd process, pid: 29287
WARN[0000] containerd: low RLIMIT_NOFILE changing to max current=1024 max=4096
ERRO[0001] devmapper: Udev sync is not supported. This will lead to data loss and unexpected behavior. Install a dynamic binary to use devicemapper or select a different storage driver. For more information, see https://docs.docker.com/engine/reference/commandline/daemon/#daemon-storage-driver-option
ERRO[0001] [graphdriver] prior storage driver "devicemapper" failed: driver not supported
FATA[0001] Error starting daemon: error initializing graphdriver: driver not supported
解決方法:
刪掉 /var/lib/docker 文件夾
#> rm -rf /var/lib/docker
重新啓動,問題解決!
#> sudo dockerd &