linux下安装与运行docker
写者环境:
1.lsb_release -a
hello@hello:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
2.更新apt和安装gpg秘钥
2.1 sudo apt-get update
2.2 sudo apt-get install apt-transport-https ca-certificates
2.3 sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
3.编辑源文件
sudo vi /etc/apt/source.list.d/docker.list (此文件不存在就直接创建即可)
将文件中的所有内容都删掉,然后写入内容入下:
deb https://apt.dockerproject.org/repo ubuntu-xenial main
4.更新apt包索引
sudo apt-get update
5.安装docker
sudo apt-get install docker-engine
6.启动docker
sudo service docker start
7.验证docker是否正在运行
sudo docker run hello-world
写者运行结果如下:
hello@hello:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b04784fba78d: Pull complete
Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f
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.
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/
8.将当前用户加入到docker组
sudo usermod -a -G docker hello
9.重启docker
sudo service docker restart
linux下安装与运行docker的更多相关文章
- Linux下安装Wine运行windows程序
资料 首页 https://www.winehq.org/ 安装 https://www.winehq.org/download/ 教程 https://www.winehq.org/document ...
- Linux下安装Wine 运行、卸载 windows程序
资料 首页 https://www.winehq.org/ 安装 https://www.winehq.org/download/ 教程 https://www.winehq.org/document ...
- linux下安装jre运行环境
上官网下载安装文件:点击打开链接 文件名:jre-8u65-linux-x64.gz安装步骤1.解压tar -xzvf jre-8u65-linux-x64.gz2.将解压后的文件放到/usr/lib ...
- 在linux下安装并运行scrapyd
系统:centos7.4 安装scrapyd:pip isntall scrapyd 因为我腾讯云上是python2与python3并存的 所以我执行的命令是:pip3 isntall scrapyd ...
- linux 下安装 jre
本文链接:https://blog.csdn.net/qq_34368587/article/details/79559102 Linux下安装Java运行环境 现需要项目部署到Linux中,需要配置 ...
- Docker学习笔记二(linux下安装Docker)
Docker学习笔记二(linux下安装Docker) 1.在线安装linux Docker 这种方式首先要保证linux 环境下可以上网,当然,小编是在自己的电脑上安装了虚拟机,在虚拟机上安装了,l ...
- Linux下安装Tomcat服务器和部署Web应用
一.上传Tomcat服务器
- Linux下安装使用Solr
Linux下安装使用Solr 1.首先下载Solr.mmseg4j分词包.tomcat并解压,这用google.百度都可以搜索得到下载地址. 2.因为要使用到中文分词,所以要设置编码,进入tomcat ...
- Linux下安装tar.gz类型的jdk,并配置环境变量
近期因要学习一门技术,必须在Linux下运行,故开始学习如何使用Linux. 在安装jdk时出现了困难,环境变量配置不成功,花了一天时间才搞定,特分享出来,供大家参考. Linux下安装jdk,步骤如 ...
随机推荐
- eclipse maven build、maven clean、maven install和maven test的区别 精析
1.情景展示 选中maven项目,右键-->Run As或Debug As-->maven buid,maven install,maven test有什么区别? 2.区别说明 ...
- cas sso原理
以下转载至https://blog.csdn.net/javaloveiphone/article/details/52439613 从结构上看,CAS包含两个部分:CAS Server 和CAS C ...
- 食物链--poj1182(并查集含有关系)
http://poj.org/problem?id=1182 题意应该就不用说了 再次回到食物链这道题,自己写了一遍,一直wa...原因竟然是不能用多实例,我也是醉了,但是我真的彻底的理解了,那 ...
- Python描述器引导(转)
原文:http://pyzh.readthedocs.io/en/latest/Descriptor-HOW-TO-Guide.html 1. Python描述器引导(翻译) 作者: Raymond ...
- JS模块化编程(三)
AMD&CMD 对象字面量 对象字面量表示,其实就是用一对大括号括起来的键值对,也就是JavaScript 声明对象的方式 var myObject = {variableKey : vari ...
- python中url解析 or url的base64编码
目录 from urllib.parse import urlparse, quote, unquote, urlencode1.解析url的组成成分:urlparse(url)2.url的base6 ...
- dedecms网站迁移时记得将安装目录放空 附迁移的正确方法
这段时间在赶一些新项目,我们建站一般都在本地服务器搭建起来,测试得差不多了才传到网上,这样对蜘蛛也相对友好一些,要不然改来改去变化太大给搜索引擎的第一印象很不好.但是由于本地环境和服务器环境还是有一些 ...
- 模仿linux内核定时器代码,用python语言实现定时器
大学无聊的时候看过linux内核的定时器,如今已经想不起来了,也不知道当时有没有看懂,如今想要模仿linux内核的定时器.用python写一个定时器,已经想不起来它的设计原理了.找了一篇blog,li ...
- 深入理解python之一——python3对象的一些特性
文章使用markdown写的,编辑的时候行间距还可以,显示的时候行间距好小,我也没办法. 首先,需要明白的是python是一种解释性语言标准,他可以由c.java或者其他语言来实现.在python的标 ...
- tomcat上部署CGI
CGI的定义是:外部应用程序与Web服务器之间的接口. 1.Tomcat7支持CGI,但是默认配置是关闭的需要进行如下配置 修改Tomcat conf/web.xml中两处代码,默认是注释掉的,去掉注 ...