背景
在无网的环境下部署nextcloud,使用mysql作为数据库并添加talk组件;镜像不能直接pull,所以需要先在有网的docker环境下讲nextcloud镜像拉去下来。
步骤1:docker安装
不说了,自行安装
步骤2:在有网络环境下拉取nextcloud
查找镜像:
docker search nextcloud

拉取镜像:docker pull nextcloud
通过:docker images
可以查看拉取的镜像:

步骤3:保存镜像,并拷贝至无网的docker中加载镜像
保存镜像:docker save -o nextcloud.tar nextcloud
OPTIONS说明:
-o :输出到的文件
加载镜像:docker load -i nextcloud.tar
OPTIONS说明:
-i :从tar归档文件读取镜像,而不是标准输入流
步骤4:通过镜像生成容器
生成容器:
docker run -d --restart=always --name nextcloud -p 80:80 nextcloud
OPTIONS说明:
-d:后台运行容器,并返回容器ID
--restart=always:保持容器运行
--name nextcloud:指定容器名
-p 80:80:将docker80端口指向宿主服务器80端口
生成并运行nextcloud容器,使用 docker ps 可以查看到容器信息:

步骤5:配置nextcloud
通过浏览器访问主机地址:80
进入nextcloud,配置管理员和数据库;

步骤6:添加talk组件
从nextcloud store官网下载talk组件,网址:https://apps.nextcloud.com/apps/spreed

将其解压拷贝至nextcloud数据目录中的apps文件下(解压后文件夹名为spreed);

从宿主服务器向docker容器拷贝文件:
1、拿到nextcloud容器ID全称:docker inspect -f ‘{{.Id}}’ nextcloud

2、文件传输:docker cp 宿主文件路径 ID全称:容器路径

最后,在nextcloud中启动spreed

docker命令
1、获取docker容器:docker ps
2、进入docker容器:docker exec -it nextcloud /bin/bash
3、删除docker容器:docker rm 容器id
3、删除docker镜像:docker rm 镜像id
网友评论