一、安装前准备:
1、查看操作系统和内核版本:
# cat /etc/redhat-release
# uname -r
2、关闭防火墙和SELinux:
# firewall-cmd --state
# sestatus
二、在线安装docker-24.0.6:
1、安装yum-utils软件包:
# yum -y install yum-utils
2、设置docker镜像源:
# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3、更新yum软件包索引:
# yum makecache fast
# yum repolist
4、
查看所有仓库中的所有docker版本,并排序:
# yum list docker-ce --showduplicates | sort -r
5、安装docker:
# yum -y install docker-ce docker-ce-cli containerd.io
6、启动docker:
# systemctl start docker
# systemctl status docker | grep running
7、设置开机自启:
# systemctl enable docker
8、查看docker版本:
# docker -v
# docker version
9、测试docker:
# docker run hello-world
# docker images
三、离线安装docker-24.0.6:
1、下载docker离线安装包:
官网下载地址https://download.docker.com/linux/static/stable/x86_64/
阿里云镜像下载地址https://mirrors.aliyun.com/docker-ce/linux/static/stable/x86_64/
2、解压离线安装包:
# tar -xf docker-24.0.6.tgz
3、将docker相关命令复制至/usr/bin目录下:
# cp -a docker/* /usr/bin/
4、
将docker注册为系统服务:
# vim /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP
$MAINPID
TimeoutStartSec=0
RestartSec=2
Restart=always
StartLimitBurst=3
StartLimitInterval=60s
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
Delegate=yes
KillMode=process
OOMScoreAdjust=-500
[Install]
WantedBy=multi-user.target
5、重载配置文件并启动docker:
# systemctl daemon-reload
# systemctl start docker
# systemctl status docker | grep running
6、设置开机自启:
# systemctl enable docker
7、查看docker版本:
# docker -v
# docker version
8、测试docker:
# docker run hello-world
四、docker其它简单配置:
1、配置docker镜像加速:
# mkdir -pv /etc/docker
# vim /etc/docker/daemon.json
{
"registry-mirrors":["https://d8b3zdiw.mirror.aliyuncs.com"]
}
说明:配置文件/etc/docker/daemon.json默认不存在
# systemctl daemon-reload
# systemctl restart docker
2、修改docker文件存储位置:
# docker info | grep 'Docker Root Dir'
说明:docker文件默认存储位置服务器托管网为/var/lib/docker
# mkdir -pv /data/docker
# vim /etc/docker/daemon.json
{
"registry-mirrors":["https://d8b3zdiw.mirror.aliyuncs.com"],
"data-root": "/data/docker"
}
# systemctl daemon-reload
# systemctl restart docker
# docker info | grep 'Docker Root Dir'
3、测试docker:
# docker run服务器托管网 hello-world
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
相关推荐: FX110:曝光TAIHONG FOREX外汇平台无法出金
近期,有多位汇友向我站爆料称在TAIHONG FOREX平台无法出金,还被各种理由催促着入金,而这个平台成立才不过两个月。 多位投资者爆料在TAIHONG FOREX无法出金 “我就是被美色害了,这个女的假装和你谈恋爱啥的,然后让你去上课,注册平台转钱进去,一…