Debian系统日常记录

Debian11的apt源

清华源

cat > /etc/apt/sources.list << EOF
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
 
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
 
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
 
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bullseye-security main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bullseye-security main contrib non-free
EOF

Debian11安装docker

更新并安装一些必要系统工具

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install \
    apt-transport-https \
    software-properties-common \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

安装GPG证书

curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/debian/gpg | apt-key add -

写入软件源信息

add-apt-repository "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian $(lsb_release -cs) stable"

更新并安装社区版Docker-ce以及docker-compose插件

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

设置开机自启动

sudo systemctl enable docker

启动

sudo systemctl start docker

测试,输入以下代码,能出现版本信息则说明安装成功

docker version

创建或修改配置文件,否则docker的默认镜像源无法下载镜像

vim /etc/docker/daemon.json

添加如下内容

{
    "registry-mirrors": ["https://docker.chenby.cn"] 
}

重新加载docker配置并重启

sudo systemctl daemon-reload
sudo systemctl restart docke

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

容器云服务

如果对你有用,一块钱也是爱。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值