赞
踩
yum install containerd.io-1.3.7-3.1.el8.x86_64.rpm
**注意:**这种情况需要将 runc 卸载
dnf remove runc
卸载完成后安装container-selinux-2.124.0-1.gitf958d0c.module_el8.3.0+569+1bada2e4.noarch.rpm
yum install container-selinux-2.124.0-1.gitf958d0c.module_el8.3.0+569+1bada2e4.noarch.rpm
container-selinux安装完成以后安装containerd.io-1.3.7-3.1.el8.x86_64.rpm
安装docker-ce
yum install docker-ce-19.03.13-3.el8.x86_64.rpm
安装docker-ce-cli
yum install docker-ce-cli-19.03.13-3.el8.x86_64.rpm
启动docker
systemctl start docker
docker主要安装了客户端 运行指令:docker --version 就会显示版本信息
若没有任何信息则表示安装成功
运行docker
systemctl start docker
加载镜像
docker load < 镜像名
例:
查看镜像
docker images
查看容器
docker ps
docker ps -a
创建容器
#基础服务 docker run -ti -d --log-opt max-size=100m --log-opt max-file=3 -p 2375:2375 --hostname=$HOSTNAME --restart=always --name shipyard-proxy -v /var/run/docker.sock:/var/run/docker.sock -e PORT=2375 shipyard/docker-proxy:latest #redis docker run -it --name redis-master --network host -e TZ=Asia/Shanghai -d redis:5.0.11 --appendonly yes --port 6300 docker run -it --name redis-slave1 --network host -e TZ=Asia/Shanghai -d redis:5.0.11 --appendonly yes --port 6301 --slaveof 172.168.169.76 6300 docker run -it --name redis-sentinel1 --network host -v /home/pascloud/redis/sentinel1.conf:/usr/local/etc/redis/sentinel.conf -d redis:5.0.11 /bin/bash docker exec -it redis-sentinel1 bash redis-server /usr/local/etc/redis/sentinel.conf --sentinel exit docker run -it --name redis-sentinel2 --network host -v /home/pascloud/redis/sentinel2.conf:/usr/local/etc/redis/sentinel.conf -d redis:5.0.11 /bin/bash docker exec -it redis-sentinel2 bash redis-server /usr/local/etc/redis/sentinel.conf --sentinel exit docker run -it --name redis-sentinel3 --network host -v /home/pascloud/redis/sentinel3.conf:/usr/local/etc/redis/sentinel.conf -d redis:5.0.11 /bin/bash docker exec -it redis-sentinel3 bash redis-server /usr/local/etc/redis/sentinel.conf --sentinel exit #zookeeper docker run --name zookeeper -d -p 2181:2181 -e TZ=Asia/Shanghai zookeeper:3.4.13 #mysql docker run --name mysql -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=tiancom -e TZ=Asia/Shanghai mysql:5.7.24 --lower_case_table_names=1 --character-set-server=utf8 --collation-server=utf8_unicode_ci #paspm docker run --name paspm -d --net=host -p 8201:8201 -p 8211:8211 -e TZ=Asia/Shanghai -v /home/pascloud/pas-cloud-service-paspm-1.5.0:/home/pascloud/pas-cloud-service-paspm-1.5.0 openjdk:8 /home/pascloud/pas-cloud-service-paspm-1.5.0/bin/start.sh #pasdemo docker run --name pasdemo -d --net=host -p 8201:8201 -p 8211:8211 -e TZ=Asia/Shanghai -v /home/pascloud/pas-cloud-service-demo-1.5.0:/home/pascloud/pas-cloud-service-demo-1.5.0 -v /nas/pascloud/dn0:/nas/pascloud/dn0 openjdk:8 /home/pascloud/pas-cloud-service-demo-1.5.0/bin/start.sh
查看容器
docker ps #查看正在运行的容器
docker ps -a #查看所有容器
容器日志查看
docker logs -f 容器名
docker重启
systemctl restart docker #docker在没有容器运行的情况下重启
docker stop 容器名 #docker停止容器运行
docker 容器重启
docker restart 容器名 #重启重启
#redis哨兵节点重启
docker exec -it redis-sentinel1 bash
redis-server /usr/local/etc/redis/sentinel.conf --sentinel
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。