阿里云OSS+docker Owncloud安装

Posted by: Wed Dec 20, 2017

安装编译所需的库

apt-get install automake autotools-dev g++ git libcurl4-gnutls-dev 
                     libfuse-dev libssl-dev libxml2-dev make pkg-config

源码编译

git clone https://github.com/aliyun/ossfs.git
cd ossfs
./autogen.sh
./configure
make
sudo make install

挂载

依次执行下面命令:

echo my-bucket:my-access-key-id:my-access-key-secret > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs
ossfs my-bucket my-mount-point -ourl=my-oss-endpoint -ouid=your_uid -ogid=your_gid -o allow_other
  • my-bucket 阿里云OSS bucket名
  • my-access-key-id 阿里云AccessKey
  • my-access-key-secret 阿里云 AccessKeySecret
  • my-oss-endpoint endpoint地址:http://oss-cn-[RegionID].aliyuncs.com 其中RegionID 参见:地域和可用区
  • 挂载权限问题:-ouid=33(www-data) -ogid=0 (root) 参见:https://github.com/aliyun/ossfs/blob/master/README-CN.md

卸载

ps -e | greop "ossfs"
kill id

docker install owncloud

docker pull owncloud
docker run -v /mnt/aliyunoss/owncloud/data:/var/www/html/data -d -p 8080:80 owncloud:8.1

comments powered by Disqus