docker
PPG007 ... 2022-2-26 Less than 1 minute
# docker
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get purge docker-ce docker-ce-cli containerd.io
1
2
2
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
1
2
3
4
5
6
2
3
4
5
6
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
1
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
1
2
3
2
3
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
1
2
2
make docker run without sudo:
# normally, this group will already exist after docker installation
sudo groupadd docker
# add user to this group, eg: sudo gpasswd -a PPG007 docker
sudo gpasswd -a $USER docker
sudo service docker restart
# then log out and log in, this will work
1
2
3
4
5
6
2
3
4
5
6
change repository:
vim /etc/docker/daemon.json
1
add this to daemon.json:
{
"registry-mirrors": ["https://ustc-edu-cn.mirror.aliyuncs.com/"]
}
1
2
3
2
3
docker-compose (opens new window)。
To install docker-compose, download from github release and move it to /usr/bin
and rename it to docker-compose, then run chmod +x /use/bin/docker-compose
。