搬山行者

无志愁压头,有志能搬山

业余程序员的学习笔记~


Ubuntu 22.04 安装 docker-ce

目录

docker 安装指令

sudo apt update

sudo apt install apt-transport-https ca-certificates curl software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update

apt-cache policy docker-ce

sudo apt install docker-ce

sudo systemctl status docker

docker-compose 安装指令

curl -SL https://github.com/docker/compose/releases/download/v2.29.6/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

docker代理设置

修改配置文件

 # /lib/systemd/system/docker.service 
[Service]
Environment="HTTP_PROXY=http://192.168.100.2:10808/" "HTTPS_PROXY=http://192.168.100.2:10808/"

重启 Docker 服务

   sudo systemctl daemon-reload
   sudo systemctl restart docker