1. 如何在CentOS环境安装docker?

1
2
3
4
5
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
systemctl start docker
# 验证是否安装成功
docker -v

2. 如何将本地镜像推送到dockerhub?

1
2
3
docker login -u <username> -p <token>
docker tag <local-image-id> <remote-username>/<reponame:version>
docker push <remote-username>/<reponame:version>