搭建自己的私有云盘(NextCloud)

1.安装docker 

yum install -y yum-utils device-mapper-persistent-data lvm2
curl -o /etc/yum.repos.d/docker-ce.repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
 yum install -y docker-ce

2.安装完设为重启和查看相应版本

systemctl start docker && systemctl status docker && docker version

3.安装加速器,重启,并设开启自启

tee /etc/docker/daemon.json <<-'EOF'
{
        "registry-mirrors": ["https://a960lhr2.mirror.aliyuncs.com"]
      
}
EOF
systemctl restart docker  && systemctl enable docker

 

4.安装数据库

docker run -d --name db_nextcloud \
    -p 3307:3306 \
    -e PUID=1000 \
    -e PGID=100 \
    -e MYSQL_ROOT_PASSWORD=123456 \
    -e MYSQL_DATABASE=nextcloud \
    -e MYSQL_USER=nextcloud \
    -e MYSQL_PASSWORD=123456 \
    --restart=unless-stopped \
    -v /sharedfolders/nextcloud/db:/var/lib/mysql \
     mariadb

5.安装NextCloud

docker run -d --name nextcloud \
       -p 8088:80 \
       --restart=unless-stopped \
       -v /sharedfolders/nextcloud/html:/var/www/html \
       -v /sharedfolders/nextcloud/data:/var/www/html/data \
       nextcloud

6.访问

浏览器输入http://你的IP:8088即可访问nextcloud了

你可能感兴趣的:(docker)