yum -y install docker
或者curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
vim /etc/docker/daemon.json
,配置如下{ "registry-mirrors":["https://32xw0apq.mirror.aliyuncs.com"] }
systemctl daemon-reload
systemctl start docker
systemctl enable docker
docker run -d --name redis -p 6390:6379 redis --requirepass "123456"
docker ps -a|grep redis
https://hub.docker.com/
,搜索mongodb:docker pull mongo:5.0.11-focal
docker images
docker run -itd --privileged=true --name mongo5 -p 27017:27017 -v /mnt/mongodb/data:/data/db mongo:5.0.11-focal
docker ps
docker ps -a
docker stop 容器名(或容器ID)
docker start 容器名(或容器ID)
docker exec -it 容器名 bash
ctrl+p+q
docker rm -f 容器名(或容器ID)
docker start $(docker ps -aq)
docker images
docker rmi ID
docker cp 容器名(或容器ID):path toPath
vi 文件
docker image inspect registry.cn-beijing.aliyuncs.com/tianzuo/fastdfs:latest|grep -i version
cp /etc/skel/.bash* /root/
,重进后即可。