1. 程式人生 > >ubuntu安裝docker實操

ubuntu安裝docker實操

安裝前檢查,檢視Ubuntu版本

Docker 要求 Ubuntu 系統的核心版本高於 3.10,並且是64位系統

  • uname -a
  • lsb_release -a
[email protected]32-248-ubuntu:~# uname -a
Linux VM-32-248-ubuntu 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

[email protected]32-248-ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:
Ubuntu 16.04.1 LTS Release: 16.04 Codename: xenial

開始安裝docker

  • apt-get install docker.io
[email protected]32-248-ubuntu:~# apt-get install docker.io
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  bridge-utils cgroupfs-mount containerd runc ubuntu-fan
Suggested packages:
  mountall aufs-tools debootstrap docker-doc rinse zfs-fuse | zfsutils
The following NEW packages will be installed:
  bridge-utils cgroupfs-mount containerd docker.io runc ubuntu-fan
0
upgraded, 6 newly installed, 0 to remove and 234 not upgraded. Need to get 17.5 MB of archives. After this operation, 90.5 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://mirrors.tencentyun.com/ubuntu xenial/main amd64 bridge-utils amd64 1.5-9ubuntu1 [28.6 kB] Get:2
http://mirrors.tencentyun.com/ubuntu xenial/universe amd64 cgroupfs-mount all 1.2 [4,970 B] Get:3 http://mirrors.tencentyun.com/ubuntu xenial-updates/universe amd64 runc amd64 1.0.0~rc2+docker1.13.1-0ubuntu1~16.04.1 [1,488 kB] Get:4 http://mirrors.tencentyun.com/ubuntu xenial-updates/universe amd64 containerd amd64 0.2.5-0ubuntu1~16.04.1 [4,041 kB] Get:5 http://mirrors.tencentyun.com/ubuntu xenial-updates/universe amd64 docker.io amd64 1.13.1-0ubuntu1~16.04.2 [11.9 MB] Get:6 http://mirrors.tencentyun.com/ubuntu xenial-updates/main amd64 ubuntu-fan all 0.12.8~16.04.2 [35.6 kB] Fetched 17.5 MB in 0s (34.5 MB/s) Selecting previously unselected package bridge-utils. (Reading database ... 64831 files and directories currently installed.) Preparing to unpack .../bridge-utils_1.5-9ubuntu1_amd64.deb ... Unpacking bridge-utils (1.5-9ubuntu1) ... Selecting previously unselected package cgroupfs-mount. Preparing to unpack .../cgroupfs-mount_1.2_all.deb ... Unpacking cgroupfs-mount (1.2) ... Selecting previously unselected package runc. Preparing to unpack .../runc_1.0.0~rc2+docker1.13.1-0ubuntu1~16.04.1_amd64.deb ... Unpacking runc (1.0.0~rc2+docker1.13.1-0ubuntu1~16.04.1) ... Selecting previously unselected package containerd. Preparing to unpack .../containerd_0.2.5-0ubuntu1~16.04.1_amd64.deb ... Unpacking containerd (0.2.5-0ubuntu1~16.04.1) ... Selecting previously unselected package docker.io. Preparing to unpack .../docker.io_1.13.1-0ubuntu1~16.04.2_amd64.deb ... Unpacking docker.io (1.13.1-0ubuntu1~16.04.2) ... Selecting previously unselected package ubuntu-fan. Preparing to unpack .../ubuntu-fan_0.12.8~16.04.2_all.deb ... Unpacking ubuntu-fan (0.12.8~16.04.2) ... Processing triggers for man-db (2.7.5-1) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for systemd (229-4ubuntu10) ... Setting up bridge-utils (1.5-9ubuntu1) ... Setting up cgroupfs-mount (1.2) ... Setting up runc (1.0.0~rc2+docker1.13.1-0ubuntu1~16.04.1) ... Setting up containerd (0.2.5-0ubuntu1~16.04.1) ... Setting up docker.io (1.13.1-0ubuntu1~16.04.2) ... Adding group `docker' (GID 117) ... Done. Setting up ubuntu-fan (0.12.8~16.04.2) ... Processing triggers for systemd (229-4ubuntu10) ... Processing triggers for ureadahead (0.100.0-19) ...

檢查安裝後的docker版本

  • docker -v
  • docker version
root@VM-32-248-ubuntu:/var/lib# docker -v
Docker version 1.13.1, build 092cba3

root@VM-32-248-ubuntu:~# docker version
Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.6.2
 Git commit:   092cba3
 Built:        Thu Nov  2 20:40:23 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.13.1
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.6.2
 Git commit:   092cba3
 Built:        Thu Nov  2 20:40:23 2017
 OS/Arch:      linux/amd64
 Experimental: false

嘗試執行hello-world

  • docker run hello-world
[email protected]32-248-ubuntu:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
ca4f61b1923c: Pull complete
Digest: sha256:66ef312bbac49c39a89aa9bcc3cb4f3c9e7de3788c944158df3ee0176d32b751
Status: Downloaded newer image for hello-world:latest

Hello 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.
    (amd64)
 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 bash

Share images, automate workflows, and more with a free Docker ID:
 https://cloud.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

[email protected]32-248-ubuntu:~# docker ps -ls
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES               SIZE
1d5943a18015        hello-world         "/hello"            49 seconds ago      Exited (0) 48 seconds ago                       jovial_thompson     0 B (virtual 1.85 kB)

更改docker使用中國官方映象

  • 修改 /etc/docker/daemon.json(如果沒有則新建一個)
{
  "registry-mirrors": ["https://registry.docker-cn.com"]
}
  • 重啟docker生效
root@VM-32-248-ubuntu:/etc/docker# service docker restart

解除安裝docker

  • apt-get remove docker-engine
[email protected]32-248-ubuntu:/var/lib# sudo apt-get remove docker.io
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  bridge-utils cgroupfs-mount containerd runc ubuntu-fan
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  docker.io
0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded.
After this operation, 50.4 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 66646 files and directories currently installed.)
Removing docker.io (1.13.1-0ubuntu1~16.04.2) ...
'/usr/share/docker.io/contrib/nuke-graph-directory.sh' -> '/var/lib/docker/nuke-graph-directory.sh'
Processing triggers for man-db (2.7.5-1) ...

相關推薦

ubuntu安裝docker

安裝前檢查,檢視Ubuntu版本 Docker 要求 Ubuntu 系統的核心版本高於 3.10,並且是64位系統 uname -a lsb_release -a [email protected]32-248-ubuntu:~# una

ubuntu安裝docker-ce

版本 erro nbsp 依賴 triggers 更新 一個 package ron Docker Community Edition (CE)/Docker社區版非常適合希望開始使用Docker並嘗試使用基於容器的應用程序的開發人員和小型團隊。Docker CE有2個版本

Ubuntu 安裝 Docker

ise sudo name 最新版 倉庫 最小 epo docker 圖片 在Ubuntu中安裝Docker Docker 目前支持以下 Ubuntu 系統: Ubuntu Xenial 16.04 (LTS) Ubuntu Wily 15.10 Ubuntu Trust

ubuntu安裝Docker容器

emc 啟動 registry hello nbsp 成功 run start apt 第一步首先更新資源: apt-get update 第二步安裝Docker: apt-get install docker 第三步安裝docker.io: apt-get install

阿里雲 linux ubuntu 安裝docker

# step 1: 安裝必要的一些系統工具 sudo apt-get update sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common # st

Ubuntu安裝Docker社群版

Docker社群版叫Docker -ce 如果安裝有老的docker先刪除老的版本  sudo apt-get remove docker docker-engine docker.io 先更新包資訊  sudo apt-get update 安裝liblt

Docker容器管理--ubuntu安裝docker

Ubuntu14.06/16.04 安裝證書 sudo apt-get install \apt-transport-https \a-certificates \curl \software-properties-common 新增Docker源的KEY curl -fsSL htt

ubuntu安裝docker,部署tomcat服務

ubuntu 安裝 docker ubuntu核心版本: uname -r 安裝:簡單方式: sudo apt-get install -y docker.io docker服務 啟動: systemctl start docker docker版本號:

ubuntu 安裝docker

基本命令 默認 project 文件 目前 17. 轉發 軟件 工作 安裝docker Docker從1.13.x版本開始,版本分為企業版EE和社區版CE,版本號也改為按照時間線來發布,比如17.03就是2017年3月。 Docker的linux發行版的軟件倉庫從以前的ht

ubuntu 安裝 docker 詳細教程

想在 ubuntu 系統上安裝 docker,方法清晰步奏簡單,但必須是64-bit的ubuntu版本,且是以下4個版本之一: Zesty 17.04 Yakkety 16.10 Xenial 16.04 (LTS) Trusty 14.04 (LTS)

ubuntu安裝docker 指定版本安裝

我的linux系統是Ubuntu 16.04。01 LTS 64位系統,通過apt的docker官方源安裝最新的Docker CE(Community Edition),即Docker社群版,是開發人員和小型團隊的理想選擇,可以指定安裝版本 開始安裝 由於apt官方庫裡的docker版

Ubuntu 安裝 docker ,以及可能遇到的問題

1. 個人建議是剛安裝好的Ubuntu系統(非新系統,我沒有試過,大家可以嘗試一下) 2. 安裝docker,並用docker -v命令驗證安裝結果; (1) 下載  sudo apt install docker.io (2) 驗證 docker -v  (顯示該版

Ubuntu 安裝Docker環境,並部署NodeJS應用

附一張規範的流程 Ubuntu版本 LSB Version: core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:

五、線上環境安裝配置(jdk-tomcat-maven-vsftpd-nginx)

#安裝JDK 直接進去根目錄,建立一個developer資料夾,cd developer/ 在使用sudo許可權建立一個sudo mkdir setup 進入setup,cd setup, 執行wget wget http://learning.happymmall

ubuntu安裝Docker CE

1. 安裝方式 你可以根據需要,以不同的方式安裝docker CE 使用repository安裝 大部分使用者設定repositories來安裝docker CE,這種方法易於安裝和升級,也是官方建議的方式。 使用deb包安裝 一些使用者下載d

ubuntu 安裝docker-ce及docker-compose

mint 18.2(Sonya)安裝docker 安裝步驟 刪除原有版本 sudo apt-get remove docker docker-engine docker.io (推薦略過這一步) 現在docker預設的檔案系統為overlay2,如果

ubuntu安裝Docker

1.ubuntu提供docker穩定版安裝: 1/sudo apt-get update 2/sudo apt-get install docker.io 解除安裝:

GitBook安裝部署手冊

前言 GitBook是一個基於Node.js的命令列工具,可使用Git和Markdown來編寫文件,讚譽太多,不再贅述。 Node.js 下載安裝包 cd /tmp wget https://nodejs.org/dist/v12.16.1/node-v12.16.1-linux-x64.tar.xz

Ubuntu 16.04 安裝Docker

his tput 64位 curl ins ade mon bfc lib 前置安裝 確保你的系統是64位 $ sudo apt-get install apt-transport-https ca-certificates curl

ubuntu 16.04 64位安裝docker

ubuntu docker 準備1.添加GPG key:$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D2.添