Ubuntu安装docker

1.更新Ubuntu的源

修改 /etc/apt/sources.list中的默认文件

cn.archive.ubuntu.com换成mirrors.aliyun.com

2.更新

1
apt-get update

3.添加docker安装源

 bash -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" 

4.更新

1
apt-get update

 出错

1
W: GPG error: https://apt.dockerproject.org ubuntu-trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F76221572C52609D

  解决方法

1
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys F76221572C52609D

  注: 

1
F76221572C52609D,apt-get update 错误提示给出了

5.再次更新源

1
apt-get update

成功

6.删除旧的LXC

1
apt-get purge lxc-docker

7. 检查apt是否为docker官方源

1
apt-cache policy docker-engine

8.安装linux-image-extra内核包,这可以允许用户使用AUFS,可以提升容器的io性能

1
apt-get install linux-image-extra-$(uname -r)

9.安装

1
apt-get install docker-engine

  启动

1
service docker start

  测试

1
docker version

10.运行第一个容器

1
docker run hello-world

  

  

 

 

  

  

  

  

 

  

 

posted @   慕尘  阅读(763)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
点击右上角即可分享
微信分享提示