Centos7虚拟机下用docker脚本安装Nextcloud备忘录

Centos7虚拟机下用docker脚本安装Nextcloud备忘录
一、安装docker和docker-compose
如果新手可以参看上一篇备忘录,大侠可以自行百度解决。
二、更改docker镜像源,加速nextcloud镜像下载
全部借用大神们的办法
1.编写/etc/docker/daemon.json文件
[root@localhost n1]# cat /etc/docker/daemon.json
{
“registry-mirrors”:[“https://docker.mirrors.ustc.edu.cn”]
}在这里插入图片描述

2.编写/etc/sysconfig/docker文件
[root@localhost n1]# cat /etc/sysconfig/docker
#Modify these options if you want to change the way the docker daemon runs
OPTIONS=’–selinux-enabled --log-driver=journald --signature-verification=false --registry-mirror=http://hub-mirror.c.163.com’

if [ -z “${DOCKER_CERT_PATH}” ]; then
DOCKER_CERT_PATH=/etc/docker
fi

Do not add registries in this file anymore. Use /etc/containers/registries.conf

from the atomic-registries package.

[root@localhost n1]#
在这里插入图片描述

3.启动docker服务
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart docker
三、编写docker-compose.yml脚本,放置到/n1目录中
[root@localhost n1]# vim docker-compose.yml
nextcloud:
image: nextcloud
container_name: nextcloud_web
links:
- nextcloud-db:nextcloud-db
environment:
- UID=1000
- GID=1000
- UPLOAD_MAX_SIZE=5G
- APC_SHM_SIZE=128M
- OPCACHE_MEM_SIZE=128
- CRON_PERIOD=15m
- TZ=Aisa/Shanghai
- ADMIN_USER=admin
- ADMIN_PASSWORD=admin@tencent
- DOMAIN=localhost
- DB_TYPE=mysql
- DB_NAME=nextcloud
- DB_USER=nextcloud
- DB_PASSWORD=nextcloud
- DB_HOST=nextcloud-db
volumes:
- /root/nextcloud/data:/var/www/html
expose:
- 80
ports:
- 80:80/tcp
restart: always
nextcloud-db:
image: mariadb:10
container_name: nextcloud_db
volumes:
- /root/nextcloud/db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=nextcloud
restart: always
四、执行脚本
[root@localhost n1]# /usr/local/bin/docker-compose up -d
Pulling nextcloud-db (mariadb:10)…
10: Pulling from library/mariadb
423ae2b273f4: Already exists
de83a2304fa1: Already exists
f9a83bce3af0: Already exists
b6b53be908de: Already exists
2b41ae57cefb: Already exists
7ecd5cacc370: Already exists
9f96ac6b2583: Already exists
9224e6c8f841: Already exists
8fdc4c2808be: Already exists
a2ae8752de58: Already exists
5adda6a0eec5: Pull complete
c3b660834848: Pull complete
1b16e5f6713a: Pull complete
3465aee3f57d: Pull complete
Digest: sha256:d1ceee944c90ee3b596266de1b0ac25d2f34adbe9c35156b75bcb9a7047c7545
Status: Downloaded newer image for mariadb:10
Pulling nextcloud (nextcloud:)…
latest: Pulling from library/nextcloud
68ced04f60ab: Pull complete
1d2a5d8fa585: Pull complete
5d59ec4ae241: Pull complete
d42331ef4d44: Pull complete
408b7b7ee112: Pull complete
570cd47896d5: Pull complete
2419413b2a16: Pull complete
8c722e1dceb9: Pull complete
34fb68439fc4: Pull complete
e775bf0f756d: Pull complete
b1949a1e9661: Pull complete
6ed8bcec42ae: Pull complete
f6247da7d55f: Pull complete
a090bafe99ea: Pull complete
fc3ce62f6763: Pull complete
47fcf653ed56: Pull complete
2dfa7c4e9831: Pull complete
5708a3ac9184: Pull complete
467a591b0d75: Pull complete
327d8e8b1ee2: Pull complete
9098ca7f79fc: Pull complete
Digest: sha256:b00fd00e2a8c018467e3b66845117c0b671dcad0179eb822a46a05940890f774
Status: Downloaded newer image for nextcloud:latest
Creating nextcloud_db … done
Creating nextcloud_web … done
[root@localhost n1]#
五、到网页中进行nextcloud的最后设置
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值