Ubuntu安装docker/docker-compose(在全新系统状态下的安装)
设置仓库
更新 apt 包索引。
$ sudo apt-get update
安装 apt 依赖包,用于通过HTTPS来获取仓库:
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
添加 Docker 的官方 GPG 密钥:
$ 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个字符,验证您现在是否拥有带有指纹的密钥。
$ 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]
使用以下指令设置稳定版仓库
$ sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ \
$(lsb_release -cs) \
stable"
安装 Docker Engine-Community
更新 apt 包索引。
$ sudo apt-get update
安装最新版本的 Docker Engine-Community 和 containerd
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
测试 Docker 是否安装成功,输入以下指令,打印出以下信息则安装成功:
$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f
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://hub.docker.com/ For more examples and ideas, visit:
https://docs.docker.com/get-started/
安装 Docker-Compose
docker-compose的安装不推荐pip安装,无论如何都会失败,用以下官方提供的方法,最后一条指令返回docker-compose的版本信息:
$ 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
$ sudo chmod +x /usr/local/bin/docker-compose
$ docker-compose --version
docker pull镜像加速源配置,docker-compose和docker共用一个,下列命令行执行完后直接重启docker服务,如果docker镜像下载速度缓慢,则重新启动系统可解决这个问题
$ sudo mkdir -p /etc/docker
$ 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(在全新系统状态下的安装)的更多相关文章
- infiniDB在linux(centos系统)下的安装使用
tar包的安装过程:http://www.docin.com/p-166891856.html 另一种方法,也可以编译安装(Debian X86_64):http://tech.it168.com/a ...
- 无网 离线状态下pip3安装 django等软件
https://stackoverflow.com/questions/7300321/how-to-use-pythons-pip-to-download-and-keep-the-zipped-f ...
- CentOS7 下 yum 安装 Docker CE
前言 Docker 使用越来越多,安装也很简单,本次记录一下基本的步骤. Docker 目前支持 CentOS 7 及以后的版本,内核要求至少为 3.10. Docker 官网有安装步骤,本文只是记录 ...
- GAMIT 10.50在Ubuntu 12.04系统下的安装
转载于:http://www.itxuexiwang.com/a/liunxjishu/2016/0225/162.html?1456480908 摘要:GAMIT/GLOBK是一套安装于Unix/L ...
- Genymotion 在win10 下的安装
首先我在Genymotion官网上并没有找到他的安装程序.据说是在注冊后,通过邮件里的链接下载,结果也没有看到.最后详细在哪下的,忘了收藏.我下的是 genymotion-2.5.3-vbox.exe ...
- Linux+Apache下如何安装SSL证书
最近很多站长在问linux系统平台下如何安装SSL证书?Linux+Apache下如何安装SSL证书?本文整理了关于Linux+Apache下如何安装SSL证书的相关教程供大家参考,更多SSL证书安装 ...
- Linux下一键安装Python3&更改镜像源&虚拟环境管理技巧
前言 之前分享过一篇<Linux系统自带Python2&yum的卸载及重装>,介绍了如何卸载及重装Linux(CentOS)自带的的Python2.7.今天主要介绍如何在Linux ...
- linux centos7下mysql安装--韩国庆
首先我先给大家介绍下MariaDB和mysql的区别. 上图,“MySQL之父”的骨灰级程序员Monty,但是mysql被Oracle收购后,Monty又开始去发展另一条数据库的道路,并且以Monty ...
- Ubuntu18.04安装docker、docker-compose、
Ubuntu18.04下Docker CE安装 Docker版本分为两个:Docker Community Edition (CE)和 Docker Enterprise Edition (EE).D ...
随机推荐
- NLog整合Exceptionless
前言 在实际的.Net Core相关项目开发中,很多人都会把NLog作为日志框架的首选,主要是源于它的强大和它的扩展性.同时很多时候我们需要集中式的采集日志,这时候仅仅使用NLog是不够的,NLog主 ...
- 记一个关于std::unordered_map并发访问的BUG
前言 刷题刷得头疼,水篇blog.这个BUG是我大约一个月前,在做15445实现lock_manager的时候遇到的一个很恶劣但很愚蠢的BUG,排查 + 摸鱼大概花了我三天的时间,根本原因是我在使用s ...
- H5跳转app代码
不罗嗦直接上代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...
- SpringBoot以war包形式部署到外部Tomcat
SpringBoot 项目打包时能打成 .jar 与 .war包文件,.jar使用 java -jar xx.jar 就可以启动,而 .war 可以部署到tomcat的 webapps 中,随tomc ...
- C++教程01:计算机系统的组成
教程首发 | 公众号:lunvey 学习C++之前,需要先了解一点基础的计算机知识.毕竟C++是跑在计算机系统上的,我们写的程序都是一段段的指令集. 首台计算机ENIAC问世之后,缺少原理指导.冯诺依 ...
- .Net -- NLog日志框架配置与使用
NLog是适用于各种.NET平台(包括.NET标准)的灵活,免费的日志记录平台,NLog可将日志写入多个目标,比如Database.File.Console.Mail.下面介绍下NLog的基本使用方法 ...
- pdf转换成文本解决格式不统一问题
pdf转换成文本解决格式不统一问题 懒得调OCR服务了,所以快速解决的方法是: pdf转png:https://pdf2png.com/zh/ png转统一格式pdf:adobe acrobat自带增 ...
- POJ-2406(KMP+字符串压缩)
Power String POJ-2406 字符串压缩模板题,但是是求有多少个这样最短的子串可以组成s. #include<iostream> #include<cstring> ...
- HDOJ-6651(数学推导)
Final Exam HDOJ-6651 这里主要考察我们的思维能力,要想自己至少可以通过k道题目,那么可以从老师的角度出发:怎么才能尽可能让你每一道题目都不通过,但是分数却是固定的. 假设我们每道题 ...
- WIFI6 基本知识(二)
WI-FI6核心技术 WI-FI6除了继承了WI-FI5的所有MIMO特性之外,还增加了许多针对高密部署场景的特性.以下是WI-FI6的核心新特性: OFDMA频分复用技术 DL/UL MU-MIMO ...