介绍
Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的镜像中,然后发布到任何流行的 Linux或Windows操作系统的机器上,也可以实现虚拟化。容器是完全使用沙箱机制,相互之间不会有任何接口。
docker安装
sudo yum install -y yum-utils device-mapper-persistent-data lvm2 sudo yum-config-manager --add-repo https://download.docker.com/linux/CentOS/docker-ce.repo
sudo yum -y install docker-ce docker-ce-cli containerd.io
yum list docker-ce --showduplicates | sort -r
sudo systemctl restart docker
sudo vi /etc/docker/daemon.json { "bip":"172.31.0.1/16" }
sudo groupadd docker
sudo usermod -aG docker ${USER} sudo chown -R ${USER}:docker /var/run/docker.sock
docker ps
sudo systemctl enable docker systemctl list-unit-files | grep docker
sudo systemctl restart docker
alias docker-compose='docker compose' docker-compose --version
|
docker-compose安装
注:上边第8步骤已经作业的情况下,下面就不用安装了
https://github.com/docker/compose/releases
wget https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 sudo mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
sudo docker-compose version
|
docker命令卸载
删除docker所在目录
rm -rf /etc/docker rm -rf /run/docker rm -rf /var/lib/dockershim rm -rf /var/lib/docker
|
Kill掉Docker进程
ps -ef | grep docker kill -9 pid
|
卸载docker相关包
yum list installed | grep docker
yum remove containerd.io.x86_64 yum remove docker-ce.x86_64 yum remove docker-ce-cli.x86_64 yum remove docker-ce-rootless-extras.x86_64 yum remove docker-compose-plugin.x86_64 yum remove docker-scan-plugin.x86_64
|