Docker

linux安装

  1. yum list installed | grep docker
  2. yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
  3. yum list | grep docker
  4. yum install -y docker-ce docker-ce-cli containerd.io
  5. vi /etc/docker/daemon.json
    {
     "registry-mirrors": ["镜像"]
    }
    
  6. systemctl start docker
  7. systemctl enable docker
  8. systemctl status docker

Docker安装ngnix

  1. docker pull nginx
  2. docker run -d --name my-nginx -p 80:80 -v /root/nginx-data/nginx.conf:/etc/nginx/nginx.conf nginx
  3. docker container list -a
  4. docker logs 649bd659dd90
  5. docker exec -it 649bd659dd90 /bin/bash
  6. docker stop 649bd659dd90
  7. docker rm 649bd659dd90
上一篇:centos 安装docker


下一篇:在阿里云服务器部署 Docker