安装docker

https://docs.docker.com/engine/install/centos/

视频教程:https://www.bilibili.com/video/BV1og4y1q7M4

Snipaste_2021-02-24_12-12-05.jpg

1.卸载旧的版本

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

安装docker

需要的安装包

yum install -y yum-utils

设置镜像仓库阿里

安装docker前需要安装的依赖包:

yum install -y yum-utils

配置阿里国内源安装docker

yum-config-manager \
    --add-repo \
    http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

安装社区版

yum install docker-ce docker-ce-cli containerd.io

启动 docker

systemctl start docker

查看版本docker version

运行hello-world

docker run hello-world

查看镜像:docker images

[root@201a06427e63 ~]# docker images

REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest f6d0b4767a6c 3 weeks ago 133MB
hello-world latest bf756fb1ae65 13 months ago 13.3kB

卸载docker

yum remove docker-ce docker-ce-cli containerd.io

删除目录

rm -rf /var/lib/docker

docer 可视化管理工具

docker run -d -p 8088:9000 --restart=always -v /var/run/docker.sock:/var/docker,sock --privileged=true portainer/portainer

docker部署阿里云ddns

AccessKey ID: LTAI4G3DZpKPfZFddWsJvMBV
AccessKey Secret: uVQb4QQbVIeeDhcZHDqZo6udybwSA6

docker run -d \

​ --name ddns \

​ --restart=always \

-e "AKID=[ALIYUN's AccessKey-ID]" \

-e "AKSCT=[ALIYUN's AccessKey-Secret]" \

-e "DOMAIN=[Domain 全称]" \

-e "REDO=600" \

chenhw2/aliyun-ddns-cli

docker run -d --name ddns --restart=always -e "AKID=LTAI4G3DZpKPfZFddWsJvMBV" -e "AKSCT=uVQb4QQbVIeeDhcZHDqZo6udybwSA6" -e "DOMAIN=pan.dashupc.com" -e "REDO=600" chenhw2/aliyun-ddns-cli


标签:docker