设置仓库

更新 apt 包索引。

  1. $ sudo apt-get update

安装 apt 依赖包,用于通过HTTPS来获取仓库:

  1. $ sudo apt-get install \
  2. apt-transport-https \
  3. ca-certificates \
  4. curl \
  5. gnupg-agent \
  6. software-properties-common

添加 Docker 的官方 GPG 密钥:

  1. $ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 通过搜索指纹的后8个字符,验证您现在是否拥有带有指纹的密钥。

  1. $ sudo apt-key fingerprint 0EBFCD88

        pub   rsa4096 2017-02-22 [SCEA]
              9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
        uid           [ unknown] Docker Release (CE deb) <docker@docker.com>
        sub   rsa4096 2017-02-22 [S]

使用以下指令设置稳定版仓库

  1. $ sudo add-apt-repository \
  2. "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ \
  3. $(lsb_release -cs) \
  4. stable"

安装 Docker Engine-Community

更新 apt 包索引。

  1. $ sudo apt-get update

安装最新版本的 Docker Engine-Community 和 containerd

  1. $ sudo apt-get install docker-ce docker-ce-cli containerd.io

测试 Docker 是否安装成功,输入以下指令,打印出以下信息则安装成功:

  1. $ sudo docker run hello-world
  2.  
  3. Unable to find image 'hello-world:latest' locally
  4. latest: Pulling from library/hello-world
  5. 1b930d010525: Pull complete Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f
  6. Status: Downloaded newer image for hello-world:latest
  7.  
  8. Hello from Docker!
  9. This message shows that your installation appears to be working correctly.
  10.  
  11. To generate this message, Docker took the following steps:
  12. 1. The Docker client contacted the Docker daemon.
  13. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
  14. (amd64)
  15. 3. The Docker daemon created a new container from that image which runs the
  16. executable that produces the output you are currently reading.
  17. 4. The Docker daemon streamed that output to the Docker client, which sent it
  18. to your terminal.
  19.  
  20. To try something more ambitious, you can run an Ubuntu container with:
  21. $ docker run -it ubuntu bash
  22.  
  23. Share images, automate workflows, and more with a free Docker ID:
  24. https://hub.docker.com/
  25.  
  26. For more examples and ideas, visit:
  27. https://docs.docker.com/get-started/

安装 Docker-Compose

docker-compose的安装不推荐pip安装,无论如何都会失败,用以下官方提供的方法,最后一条指令返回docker-compose的版本信息:

  1. $ sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
  1. $ sudo chmod +x /usr/local/bin/docker-compose
  1. $ docker-compose --version

docker pull镜像加速源配置,docker-compose和docker共用一个,下列命令行执行完后直接重启docker服务,如果docker镜像下载速度缓慢,则重新启动系统可解决这个问题

  1. $ sudo mkdir -p /etc/docker
  1. $ sudo tee /etc/docker/daemon.json <<-'EOF'
    {
      "registry-mirrors": ["https://fudfkcar.mirror.aliyuncs.com"]
    }
    EOF

至此安装docker与docker-compose完成,现在可享用docker

docker的安装采摘自:https://www.runoob.com/docker/ubuntu-docker-install.html

Ubuntu安装docker/docker-compose(在全新系统状态下的安装)的更多相关文章

  1. infiniDB在linux(centos系统)下的安装使用

    tar包的安装过程:http://www.docin.com/p-166891856.html 另一种方法,也可以编译安装(Debian X86_64):http://tech.it168.com/a ...

  2. 无网 离线状态下pip3安装 django等软件

    https://stackoverflow.com/questions/7300321/how-to-use-pythons-pip-to-download-and-keep-the-zipped-f ...

  3. CentOS7 下 yum 安装 Docker CE

    前言 Docker 使用越来越多,安装也很简单,本次记录一下基本的步骤. Docker 目前支持 CentOS 7 及以后的版本,内核要求至少为 3.10. Docker 官网有安装步骤,本文只是记录 ...

  4. GAMIT 10.50在Ubuntu 12.04系统下的安装

    转载于:http://www.itxuexiwang.com/a/liunxjishu/2016/0225/162.html?1456480908 摘要:GAMIT/GLOBK是一套安装于Unix/L ...

  5. Genymotion 在win10 下的安装

    首先我在Genymotion官网上并没有找到他的安装程序.据说是在注冊后,通过邮件里的链接下载,结果也没有看到.最后详细在哪下的,忘了收藏.我下的是 genymotion-2.5.3-vbox.exe ...

  6. Linux+Apache下如何安装SSL证书

    最近很多站长在问linux系统平台下如何安装SSL证书?Linux+Apache下如何安装SSL证书?本文整理了关于Linux+Apache下如何安装SSL证书的相关教程供大家参考,更多SSL证书安装 ...

  7. Linux下一键安装Python3&更改镜像源&虚拟环境管理技巧

    前言 之前分享过一篇<Linux系统自带Python2&yum的卸载及重装>,介绍了如何卸载及重装Linux(CentOS)自带的的Python2.7.今天主要介绍如何在Linux ...

  8. linux centos7下mysql安装--韩国庆

    首先我先给大家介绍下MariaDB和mysql的区别. 上图,“MySQL之父”的骨灰级程序员Monty,但是mysql被Oracle收购后,Monty又开始去发展另一条数据库的道路,并且以Monty ...

  9. Ubuntu18.04安装docker、docker-compose、

    Ubuntu18.04下Docker CE安装 Docker版本分为两个:Docker Community Edition (CE)和 Docker Enterprise Edition (EE).D ...

随机推荐

  1. CSS 阴影效果

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. git相关问题

    1.git查看远程分支更新到本地 git clone 项目地址,示例如下: git clone https://github.com/zhongyushi-git/vue-test.git 在拉取时, ...

  3. Pyqt5——表格中隐藏的控件(Model/View/Delegate)

    需求:在TableView表格中点击单元格可以实现编辑功能.性别由LineEdite控件编辑,年龄由spinBox控件编辑. 实现:(1)使用Qt的model-view模式生成表格视图.    (2) ...

  4. go 报错 import cycle not allowed

    运行时报错,import cycle not allowed : 查了goole大概知道了原因,还是导包类的问题,我检察了一下我的代码库,发现我昨天划分几个工具文件,里面的两个文件相互引用,就导致报i ...

  5. 摄像机+LookAt矩阵+视角移动+欧拉角

    一: 摄像机 OpenGL本身没有摄像机(Camera)的概念,但我们可以通过把场景中的所有物体往相反方向移动的方式来模拟出摄像机,产生一种我们在移动的感觉,而不是场景在移动. 以摄像机的视角作为场景 ...

  6. HDR(高动态范围)

    一: 简介 一般来说,当存储在帧缓冲(Framebuffer)中时,亮度和颜色的值是默认被限制在0.0到1.0之间的. 但是如果我们遇上了一个特定的区域,其中有多个亮光源使这些数值总和超过了1.0,又 ...

  7. 记录实践PC端微信防撤回实现过程(基于3.1.0.67版本)

    利用OD实现对PC端微信防撤回功能的实现 文章最后有一键补丁工具哦~ 准备工具 1.OD 2.PC微信客户端(3.1.0.67) 过程 1.运行微信客户端,不需要登录 2.运行OD,左上角选择附加进程 ...

  8. Kibana 插件环境搭建教程

    原文 环境背景, Kibana 7.4.0, Elasticsearch 7.4.0 注意, 执行以下命令时, 尽量在管理员权限的命令行窗口里执行, 避免一些没有权限的报错; 1. 准备 Kibana ...

  9. 【RocketMQ源码分析】深入消息存储(1)

    最近在学习RocketMQ相关的东西,在学习之余沉淀几篇笔记. RocketMQ有很多值得关注的设计点,消息发送.消息消费.路由中心NameServer.消息过滤.消息存储.主从同步.事务消息等等. ...

  10. weblogic弱口令+后台getshell

     https://www.cnblogs.com/bmjoker/p/9822886.html利用docker环境模拟了一个真实的weblogic环境,其后台存在一个弱口令,并且前台存在任意文件读取漏 ...