MelonBlog

centos安装docker

卸载旧版本

sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

通过yum安装

设置repo

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

安装最新版docker

sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

启动

sudo systemctl start docker

验证

sudo docker run hello-world

常用镜像

# mysql
docker pull mysql:5.7
docker run -itd --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw mysql:5.7

友情链接


Copyright © 2023 www.tiangua.info 鄂ICP备2022015834号