Docker安裝(Ubuntu 64bit)的方法步驟
內(nèi)核支持
如果我們使用的ubuntu系統(tǒng)是14.04之前的版本,我們需要先升級內(nèi)核。
$ sudo apt-get update $ sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual $ sudo reboot
添加GPG密鑰
Docker安裝
首先需要安裝apt-transport-https支持和Docker庫的密鑰。
$ sudo apt-get install apt-transport-https ca-certificates $ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
添加Docker安裝源
我們需要根據(jù)自己的系統(tǒng)版本添加對應(yīng)的docker源
$ sudo echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list $ sudo apt-get update
各版本對應(yīng)的源如下:
Ubuntu Precise 12.04 (LTS): deb https://apt.dockerproject.org/repo ubuntu-precise main
Ubuntu Trusty 14.04 (LTS): deb https://apt.dockerproject.org/repo ubuntu-trusty main
Ubuntu Wily 15.10: deb https://apt.dockerproject.org/repo ubuntu-wily main
Ubuntu Xenial 16.04 (LTS): deb https://apt.dockerproject.org/repo ubuntu-xenial main
安裝
我們先查看一下當(dāng)前可以安裝的版本都有哪些。
$ sudo apt-cache policy docker-engine docker-engine: Installed: (none) Candidate: 17.05.0~ce-0~ubuntu-trusty Version table: 17.05.0~ce-0~ubuntu-trusty 0 500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages 17.04.0~ce-0~ubuntu-trusty 0 500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages 17.03.1~ce-0~ubuntu-trusty 0 500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages 17.03.0~ce-0~ubuntu-trusty 0 500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages 1.13.1-0~ubuntu-trusty 0 500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages 1.13.0-0~ubuntu-trusty 0 500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages 1.12.6-0~ubuntu-trusty 0 500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages ...
接下來就可以安裝特定版本的docker了,不過如果我們之前有安裝過docker,首先需要刪除之前安裝的就版本。
# 卸載舊版docker $ sudo apt-get purge docker docker.io lxc-docker docker-engine $ sudo apt-get install docker-engine=17.05.0~ce-0~ubuntu-trusty $ sudo docker -v Docker version 17.05.0-ce, build 89658be
下載Ubuntu鏡像
下載Ubuntu鏡像,然后啟動一個Container測試是否安裝成功。
$ docker pull ubuntu $ docker run -i -t ubuntu bash
成功之后,運(yùn)行exit即可退出docker。
參考文檔
https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/ Docker官方文檔
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
CentOS系統(tǒng)下docker的安裝配置及使用介紹
這篇文章主要介紹了CentOS系統(tǒng)下docker的安裝配置及使用詳細(xì)介紹,需要的朋友可以參考下2016-10-10docker在windows創(chuàng)建卷后本地找不到的完美解決方法
這篇文章主要介紹了docker在windows創(chuàng)建卷后本地找不到的完美解決方法,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2024-02-02docker在已有的tomcat鏡像上打新的鏡像的Dockerfile編寫說明介紹
這篇文章主要介紹了docker在已有的tomcat鏡像上打新的鏡像的Dockerfile編寫說明介紹,需要的朋友可以參考下2016-10-10Docker 多主機(jī)網(wǎng)絡(luò)通信詳細(xì)介紹
這篇文章主要介紹了Docker 多主機(jī)網(wǎng)絡(luò)通信詳細(xì)介紹的相關(guān)資料,需要的朋友可以參考下2016-10-10Dockerfile 部署java web的環(huán)境詳解
這篇文章主要介紹了Dockerfile 構(gòu)建java web 環(huán)境詳解的相關(guān)資料,這里對Dockerfile 進(jìn)行基本介紹,并說明如何構(gòu)建java web環(huán)境進(jìn)行詳解,需要的朋友可以參考下2016-12-12docker的overlay2中存的都是什么及如何清理/var/lib/docker/overlay2
docke roverlay2是Docker中的存儲驅(qū)動之一,用于管理鏡像和容器層的數(shù)據(jù),這篇文章主要給大家介紹了關(guān)于docker的overlay2中存的都是什么及如何清理/var/lib/docker/overlay2的相關(guān)資料,需要的朋友可以參考下2024-04-04