debian中安装docker
安装命令
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/debian \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
wsl 安装的 debian 会出现iptables问题
- 替换iptables为iptables-legacy
sudo apt-get install iptables
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
- 开启ipv4转发
sudo sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf
- 重启
wsl --shutdown
再启动debian,启动docker就能成功了。
启动docker daemon服务
sudo service docker start
验证
sudo docker run hello-world
标签:iptables,get,sudo,apt,docker,安装,debian
From: https://www.cnblogs.com/yangwen0228/p/16940397.html