docker-ce 即 DOCKER ENGINE - COMMUNITY
目前我没遇到,但是还是卸载一下比较好
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
显示
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) <docker@docker.com>
sub rsa4096 2017-02-22 [S]
与指纹的后8个字符9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
相同
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce
sudo apt-get update
apt-cache madison docker-ce
显示
docker-ce | 5:19.03.7~3-0~debian-stretch | https://download.docker.com/linux/debian stretch/stable amd64 Packages
docker-ce | 5:19.03.6~3-0~debian-stretch | https://download.docker.com/linux/debian stretch/stable amd64 Packages
docker-ce | 5:19.03.5~3-0~debian-stretch | https://download.docker.com/linux/debian stretch/stable amd64 Packages
...
sudo apt-get install docker-ce=<VERSION_STRING>
<VERSION_STRING>
即 5:19.03.7~3-0~debian-stretch
Compose repository release page on GitHub
curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
Docker可以通过启动命令来限制容器可以使用的最大物理内存和swap,但是通常在使用这些命令的时候经常会碰到“WARNING: No swap limit support”警告,大概意思就是不支持swap内存的限制。
vi /etc/default/grub
GRUB_CMDLINE_LINUX
的内容后进行追加,原内容不要改动cgroup_enable=memory swapaccount=1
添加之前要加上空格,使其和前面的内容分开
# This file was created by bootstrap-vz.
# See https://github.com/andsens/bootstrap-vz/blob/master/LICENSE for
# legal notices and disclaimers.
GRUB_TERMINAL="console"
GRUB_CMDLINE_LINUX="console=ttyS0,38400n8 elevator=noop scsi_mod.use_blk_mq=Y net.ifnames=0 biosdevname=0 cgroup_enable=memory swapaccount=1"
GRUB_TIMEOUT=0
GRUB_SERIAL_COMMAND="serial"
GRUB_DISABLE_RECOVERY=True
GRUB_GFXMODE="auto"
GRUB_HIDDEN_TIMEOUT_QUIET=True
GRUB_HIDDEN_TIMEOUT=0
GRUB_DEFAULT=0
sudo update-grub
reboot