docker 安装(ubuntu)

更新apt库安装包索引

sudo apt-get update

由于访问docker库需要使用https,需要安装https的依赖包

$sudo apt-get install apt-transport-https ca-certificates curl gunpg-agent software-properties-common

添加docker的官方GPG公钥:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

校验公钥是否添加成功,通过搜索公钥fingerprint后八位即可验证(9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88):

$ sudo apt-key fingerprint 0EBFCD88

通过下面命令将stable(稳定版)docker库添加到本地apt仓库

$ sudo add-apt-repository    "deb [arch=amd64] https://download.docker.com/linux/ubuntu    $(lsb_release -cs)    stable"

更新本地仓库包索引:

sudo apt-get update

列出本地仓库可用的版本列表:

apt-cache madison docker-ce

执行安装: sudo apt-get install docker-ce=5:19.03.6~3-0~ubuntu-bionic docker-ce-cli=5:19.03.6~3-0~ubuntu-bionic containerd.io

报错,提示执行: sudo dpkg --configure -a

执行之:

执行Ok后继续安装:

[email protected]:/var/cache/apt/archives$ sudo apt-get install docker-ce=5:19.03.6~3-0~ubuntu-bionic docker-ce-cli=5:19.03.6~3-0~ubuntu-bionic containerd.io
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  aufs-tools cgroupfs-mount libltdl7 linux-modules-extra-4.15.0-88-generic pigz
The following NEW packages will be installed:
  aufs-tools cgroupfs-mount containerd.io docker-ce docker-ce-cli libltdl7 pigz
The following packages will be upgraded:
  linux-modules-extra-4.15.0-88-generic
1 upgraded, 7 newly installed, 0 to remove and 18 not upgraded.
1 not fully installed or removed.
Need to get 85.8 MB/119 MB of archives.
After this operation, 554 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu bionic/universe amd64 pigz amd64 2.4-1 [57.4 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic/universe amd64 aufs-tools amd64 1:4.9+20170918-1ubuntu1 [104 kB]
Get:3 https://download.docker.com/linux/ubuntu bionic/stable amd64 containerd.io amd64 1.2.13-1 [20.1 MB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/universe amd64 cgroupfs-mount all 1.4 [6,320 B]
Get:5 http://archive.ubuntu.com/ubuntu bionic/main amd64 libltdl7 amd64 2.4.6-2 [38.8 kB]
Get:6 https://download.docker.com/linux/ubuntu bionic/stable amd64 docker-ce-cli amd64 5:19.03.6~3-0~ubuntu-bionic [42.5 MB]
Get:7 https://download.docker.com/linux/ubuntu bionic/stable amd64 docker-ce amd64 5:19.03.6~3-0~ubuntu-bionic [22.9 MB]
Get:7 https://download.docker.com/linux/ubuntu bionic/stable amd64 docker-ce amd64 5:19.03.6~3-0~ubuntu-bionic [22.9 MB]
Fetched 73.4 MB in 19min 43s (62.0 kB/s)
(Reading database ... 68238 files and directories currently installed.)
Preparing to unpack .../0-linux-modules-extra-4.15.0-88-generic_4.15.0-88.88_amd64.deb ...
Unpacking linux-modules-extra-4.15.0-88-generic (4.15.0-88.88) over (4.15.0-88.88) ...
Selecting previously unselected package pigz.
Preparing to unpack .../1-pigz_2.4-1_amd64.deb ...
Unpacking pigz (2.4-1) ...
Selecting previously unselected package aufs-tools.
Preparing to unpack .../2-aufs-tools_1%3a4.9+20170918-1ubuntu1_amd64.deb ...
Unpacking aufs-tools (1:4.9+20170918-1ubuntu1) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../3-cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Selecting previously unselected package containerd.io.
Preparing to unpack .../4-containerd.io_1.2.13-1_amd64.deb ...
Unpacking containerd.io (1.2.13-1) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../5-docker-ce-cli_5%3a19.03.6~3-0~ubuntu-bionic_amd64.deb ...
Unpacking docker-ce-cli (5:19.03.6~3-0~ubuntu-bionic) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../6-docker-ce_5%3a19.03.6~3-0~ubuntu-bionic_amd64.deb ...
Unpacking docker-ce (5:19.03.6~3-0~ubuntu-bionic) ...
Selecting previously unselected package libltdl7:amd64.
Preparing to unpack .../7-libltdl7_2.4.6-2_amd64.deb ...
Unpacking libltdl7:amd64 (2.4.6-2) ...
Setting up aufs-tools (1:4.9+20170918-1ubuntu1) ...
Setting up linux-modules-extra-4.15.0-88-generic (4.15.0-88.88) ...
Setting up containerd.io (1.2.13-1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/containerd.service → /lib/systemd/system/containerd.service.
Setting up cgroupfs-mount (1.4) ...
Setting up libltdl7:amd64 (2.4.6-2) ...
Setting up docker-ce-cli (5:19.03.6~3-0~ubuntu-bionic) ...
Setting up pigz (2.4-1) ...
Setting up docker-ce (5:19.03.6~3-0~ubuntu-bionic) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for systemd (237-3ubuntu10.38) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for linux-image-4.15.0-88-generic (4.15.0-88.88) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.15.0-88-generic
I: The initramfs will attempt to resume from /dev/sda4
I: (UUID=c930ee23-9416-4e50-8959-d67def1b18fd)
I: Set the RESUME variable to override this.
/etc/kernel/postinst.d/x-grub-legacy-ec2:
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /vmlinuz-4.15.0-88-generic
Found kernel: /vmlinuz-4.15.0-76-generic
Found kernel: /vmlinuz-4.15.0-88-generic
Found kernel: /vmlinuz-4.15.0-76-generic
Updating /boot/grub/menu.lst ... done

/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub‘
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-88-generic
Found initrd image: /boot/initrd.img-4.15.0-88-generic
Found linux image: /boot/vmlinuz-4.15.0-76-generic
Found initrd image: /boot/initrd.img-4.15.0-76-generic
done

完成安装。

原文地址:https://www.cnblogs.com/liwutao/p/12444974.html

时间: 2024-10-01 04:24:14

docker 安装(ubuntu)的相关文章

002.Docker安装部署

一 docker安装-CentOS系统 1.1 docker自动安装脚本 1 [email protected]:~# wget -qO- https://get.docker.com/ | sh 2 或-- 3 [email protected]:~# curl -sSL https://get.docker.com/ | sh 注意:若出现以下错误,可使用yum解决依赖-- Delta RPMs disabled because /usr/bin/yum provides applydelt

ubuntu下docker安装与版本升级

ubuntu 下docker安装与版本升级 一.系统环境 系统:ubuntu-server 14.04 x86_64 内核:3.13.0-32-generic 二.Docker安装 --------------------------------------------------------------------------------- 要想安装最新版本的Docker需要使用Docker源来安装 $ sudo su - root # apt-get -y installapt-transp

Docker的ubuntu镜像安装的容器无ifconfig和ping命令的解决

Docker的Ubuntu镜像安装的容器无ifconfig命令和ping命令 解决: apt-get update apt install net-tools       # ifconfig apt install iputils-ping     # ping

Ubuntu下用docker安装redis镜像和使用redis容器分享

Ubuntu下用docker安装redis镜像和使用redis容器分享 1. 安装Ubuntu 2. 用Putty登录Ubuntu Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-40-generic x86_64) * Documentation:  https://help.ubuntu.com/ System information as of Wed Dec 31 06:41:16 UTC 2014 System load:  0.01  

Windows 7中的VirtualBox中的Ubuntu 14.04中基于Docker安装Hadoop

1. 在VirtualBox中安装Ubuntu 14.04 2. 在Ubuntu 14.04中安装Docker 3. 安装基于Docker的Hadoop 下载image docker pull sequenceiq/hadoop-docker:2.6.0   运行container docker run -i -t sequenceiq/hadoop-docker:2.6.0 /etc/bootstrap.sh –bash   测试Hadoop(将ubuntu的内存调到2G,即2048MB,否则

docker安装步骤翻译ubuntu

本问是根据docker官方文档翻译,原文:https://docs.docker.com/engine/installation/linux/ubuntulinux/ Docker 支持以下 Ubuntu 系统: Ubuntu Xenial 16.04 (LTS) Ubuntu Wily 15.10 Ubuntu Trusty 14.04 (LTS) Ubuntu Precise 12.04 (LTS) 本页内容指引你安装使用由Docker管理的正式包和管理包. 使用这些安装包能确保你安装 Do

Docker体验 Ubuntu下安装

简介 一个类似于虚拟机的轻量级容器. 官方网址https://www.docker.com 官方有一个在线模拟环境: https://www.docker.com/tryit/ 安装 从官网介绍来看,它支持的操作系统非常多,基本许多我没见过的. 我的测试环境是Ubuntu Kylin 14.04 需求 推荐使用64-bit,kernel 最低3.10,可以使用 uname-r查看 我用的Ubuntu版本比较高,官方介绍可以跳过一些操作. 安装过程 安装需要sudo权限 确定安装了wget whi

Docker在ubuntu和centos的安装

Docker介绍 Docker 使用Google公司推出的Go语言进行开发基于 Linux 内核的cgroup,namespace,以及 AUFS 类的 Union FS 等技术,对进程进行封装隔离,属于操作系统层面的虚拟化技术. Docker组件说明 LXC Linux容器技术,共享内核,容器共享宿主机资源,使用namespace和cgroups对资源限制与隔离. Cgroups(control groups) Linux内核提供的一种限制单进程或者多进程资源的机制:比如CPU.内存等资源的使

Docker版本与centos和ubuntu环境下docker安装介绍

# Docker版本与安装介绍 * Docker-CE 和 Docker-EE * Centos 上安装 Docker-CE * Ubuntu 上安装 Docker-CE ## Docker-CE和Docker-EE Docker-CE指Docker社区版,由社区维护和提供技术支持,为免费版本,适合个人开发人员和小团队使用. Docker-EE指Docker企业版,为收费版本,由售后团队和技术团队提供技术支持,专为企业开发和IT团队而设计.相比Docker-CE,增加一些额外功能,更重要的是提供

Docker安装及简单使用(Ubuntu)

### Ubuntu18下docker安装 * step 1: 安装必要的一些系统工具 sudo apt-get update sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common * step 2: 安装GPG证书 curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-k