ubuntu:最新安装使用docker

前言

        系统:ubuntu 22.04 desktop

        目的:安装使用docker

 安装小猫猫

        没有安装包的,可以自己去瞅瞅,这里不提供下载方式

sudo dpkg -i ./cat-verge_1.7.5_amd64.deb

         在应用里,打开这个软件,并开启系统猫猫

配置apt猫猫

# 创建apt配置文件
vim /etc/apt/apt.conf.d/95proxies

# 并添加以下内容
Acquire::http::Proxy "http://127.0.0.1:7897/"; # 使用猫猫
Acquire::https::Proxy "http://127.0.0.1:7897/";

# 更新apt-get缓存
sudo apt-get update

安装docker

# 更新apt
sudo apt update

# 安装一些必要的包
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

# 导入源仓库的 GPG key(这里需要加上猫猫)
curl -x http://127.0.0.1:7897 -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# 将 Docker APT 软件源添加到apt
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

# 安装docker
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io

# 开启docker服务
sudo systemctl status docker

配置docker猫猫

        给docker配上猫猫,使其从docker官方镜像中拉取目标资源

# 创建docker网络猫猫服务
mkdir /etc/systemd/system/docker.service.d/ 
vim /etc/systemd/system/docker.service.d/http-proxy.conf

# 添加如下
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:7897"
Environment="HTTPS_PROXY=http://127.0.0.1:7897"

# 重启docker
systemctl daemon-reload
systemctl restart docker

# 检查猫猫
docker info | grep -i proxy

        看到自己的猫猫配置就表示成功绑定了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值