如何在网站上做自动弹出写男主重生做网站的小说
Docker 笔记(一)–安装
记录Docker 安装操作记录,便于查询。
参考
- 链接: Docker 入门到实战教程(二)安装Docker
 - 链接: docker入门(利用docker部署web应用)
 - 链接: 阿里云容器镜像服务/镜像加速器/操作文档
 - 链接: 网易镜像中心
 - 链接: 阿里云镜像站
 
环境
Centos 7.9
安装
1.检查操作系统环境和版本
Docker 要求 CentOS 系统的内核版本高于 3.10,系统为64位
[root@centos7-18 ~]# cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)
Red Hat Enterprise Linux Server release 4.5 (Tikanga)
[root@centos7-18 ~]# 
 
[root@centos7-18 ~]# uname -r
3.10.0-1160.6.1.el7.x86_64
[root@centos7-18 ~]# 
 
2.如果安装过,需要先卸载
yum remove docker \docker-client \docker-client-latest \docker-common \docker-latest \docker-latest-logrotate \docker-logrotate \docker-engine
 
3.安装Docker
3.1 安装依赖
[root@centos7-18 ~]# yum install -y yum-utils  device-mapper-persistent-data  lvm2
 
3.2 添加Docker源
 使用阿里云的Docker源
[root@centos7-18 yum.repos.d]#yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo已加载插件:fastestmirror, langpacks
adding repo from: https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
 
[root@centos7-18 yum.repos.d]#  ll  /etc/yum.repos.d/
总用量 60
-rw-r--r--. 1 root root 2523 6月  16 2018 CentOS-Base.repo
-rw-r--r--. 1 root root 1664 11月 30 2016 CentOS-Base.repo.bak
-rw-r--r--. 1 root root 1309 10月 23 2020 CentOS-CR.repo
-rw-r--r--. 1 root root  649 10月 23 2020 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  314 10月 23 2020 CentOS-fasttrack.repo
-rw-r--r--. 1 root root  630 10月 23 2020 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 10月 23 2020 CentOS-Sources.repo
-rw-r--r--. 1 root root 8515 10月 23 2020 CentOS-Vault.repo
-rw-r--r--. 1 root root  616 10月 23 2020 CentOS-x86_64-kernel.repo
// Docker源
-rw-r--r--  1 root root 2081 11月 15 2023 docker-ce.repo
-rw-r--r--. 1 root root 1050 11月  1 2020 epel.repo
-rw-r--r--. 1 root root 1149 11月  1 2020 epel-testing.repo
 
3.3 安装最新版
[root@centos7-18 yum.repos.d]# sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
 
安装说明: 摘自《功能解释:containerd.io、docker-ce、docker-ce-cli、docker-buildx-plugin、docker-compose-plugin、docker.io》
-  
docker containerd.io
是Docker容器运行时的核心组件之一,它负责管理和运行容器。它提供了容器的生命周期管理、镜像管理、网络管理等功能。 -  
docker-ce
是Docker Community Edition的缩写,是Docker的社区版本。它是一个开源的容器化平台,提供了构建、发布和运行容器的工具和服务。广义来说,docker-ce包含了dockerd(Docker守护进程)、docker命令行工具、docker-compose等组件;狭义上来讲,docker-ce 是与 docker containerd.io、docker-ce-cli 并列的服务组件。 -  
docker-ce-cli
是Docker Community Edition的命令行工具(command line)。它提供了与Docker守护进程进行交互的命令行接口,可以用于管理和操作Docker容器、镜像、网络等。 -  
docker-buildx-plugin
是Docker的一个插件,用于构建多平台的容器镜像。它可以在一个构建过程中同时构建多个不同平台的镜像,例如x86、ARM等。这样可以方便地为不同平台的设备提供适配的容器镜像。 -  
docker-compose-plugin
是Docker的一个插件,用于管理和编排多个容器的运行。它可以通过一个单独的配置文件定义多个容器之间的关系和依赖,然后通过简单的命令就可以启动、停止、删除这些容器。 
3.4 查看版本
[root@centos7-18 yum.repos.d]# docker version
Client: Docker Engine - CommunityVersion:           24.0.7API version:       1.43Go version:        go1.20.10Git commit:        afdd53bBuilt:             Thu Oct 26 09:11:35 2023OS/Arch:           linux/amd64Context:           default
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
 
3.5 启动Docker
[root@centos7-18 yum.repos.d]# systemctl start docker
// 添加开机自启动
//[root@centos7-18 yum.repos.d]# systemctl enable docker
 
[root@centos7-18 yum.repos.d]# ps -ef | grep docker
root     12338     1  0 13:43 ?        00:00:00 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
root     12792  9696  0 13:49 pts/0    00:00:00 grep --color=auto docker
[root@centos7-18 yum.repos.d]# 
 
3.6 配置国内镜像源
{"registry-mirrors": [// 阿里云的配置详见“容器镜像服务”-“镜像加速器”-“对应的操作系统”"https://xxxxxxx.mirror.aliyuncs.com","http://hub-mirror.c.163.com","https://docker.mirrors.ustc.edu.cn","https://registry.docker-cn.com"]
}
 
[root@centos7-18 docker]# systemctl daemon-reload
[root@centos7-18 docker]# systemctl restart docker
 
[root@centos7-18 docker]# docker info
Client: Docker Engine - CommunityVersion:    24.0.7Context:    defaultDebug Mode: falsePlugins:buildx: Docker Buildx (Docker Inc.)Version:  v0.11.2Path:     /usr/libexec/docker/cli-plugins/docker-buildxcompose: Docker Compose (Docker Inc.)Version:  v2.21.0Path:     /usr/libexec/docker/cli-plugins/docker-composeServer:Containers: 0Running: 0Paused: 0Stopped: 0Images: 0Server Version: 24.0.7Storage Driver: overlay2Backing Filesystem: xfsSupports d_type: trueUsing metacopy: falseNative Overlay Diff: trueuserxattr: falseLogging Driver: json-fileCgroup Driver: cgroupfsCgroup Version: 1Plugins:Volume: localNetwork: bridge host ipvlan macvlan null overlayLog: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslogSwarm: inactiveRuntimes: io.containerd.runc.v2 runcDefault Runtime: runcInit Binary: docker-initcontainerd version: 61f9fd88f79f081d64d6fa3bb1a0dc71ec870523runc version: v1.1.9-0-gccaecfcinit version: de40ad0Security Options:seccompProfile: builtinKernel Version: 3.10.0-1160.6.1.el7.x86_64Operating System: CentOS Linux 7 (Core)OSType: linuxArchitecture: x86_64CPUs: 2Total Memory: 1.791GiBName: centos7-18.localdomainID: ff9448d2-60cd-4dfb-8d41-26afa972b45bDocker Root Dir: /var/lib/dockerDebug Mode: falseExperimental: falseInsecure Registries:127.0.0.0/8Registry Mirrors:https://xxxxxxxx.mirror.aliyuncs.com/http://hub-mirror.c.163.com/https://docker.mirrors.ustc.edu.cn/https://registry.docker-cn.com/Live Restore Enabled: false
 
镜像源
网易:http://hub-mirror.c.163.com
中科大镜像地址:http://mirrors.ustc.edu.cn/
中科大github地址:https://github.com/ustclug/mirrorrequest
Azure中国镜像地址:http://mirror.azure.cn/
Azure中国github地址:https://github.com/Azure/container-service-for-azure-china
DockerHub镜像仓库: https://hub.docker.com/ 
阿里云镜像仓库: https://cr.console.aliyun.com 
google镜像仓库: https://console.cloud.google.com/gcr/images/google-containers/GLOBAL (如果你本地可以翻墙的话是可以连上去的 )
coreos镜像仓库: https://quay.io/repository/ 
RedHat镜像仓库: https://access.redhat.com/containers
