{"id":1254,"date":"2017-09-08T23:57:01","date_gmt":"2017-09-08T15:57:01","guid":{"rendered":"https:\/\/actom.me\/blog\/?p=1254"},"modified":"2017-09-08T23:57:01","modified_gmt":"2017-09-08T15:57:01","slug":"collabora-code-%e5%a2%9e%e5%8a%a0%e5%ad%97%e4%bd%93","status":"publish","type":"post","link":"https:\/\/actom.me\/blog\/collabora-code-%e5%a2%9e%e5%8a%a0%e5%ad%97%e4%bd%93.html","title":{"rendered":"Collabora CODE \u589e\u52a0\u5b57\u4f53"},"content":{"rendered":"<p>Collabora CODE \u7684 Docker\u955c\u50cf\u5b89\u88c5\u5e76\u542f\u52a8\u540e\uff0c\u9ed8\u8ba4\u4e2d\u6587\u5b57\u4f53\u53ea\u5e26\u4e86Note Sans SC\uff0c\u800c\u4e14\uff0c\u5f88\u591a\u6c49\u5b57\u9ed8\u8ba4\u4f1afallback\u5230\u65e5\u6587\u5b57\u4f53\uff0c\u5b89\u88c5\u4e00\u7cfb\u5217\u5e38\u7528\u5b57\u4f53\u975e\u5e38\u6709\u5fc5\u8981\uff0c\u4e3a\u4fdd\u8bc1\u90e8\u7f72\u65b9\u4fbf\uff0c\u5199\u4e86\u4e2aDockerfile\u751f\u6210\u81ea\u5df1\u7684\u955c\u50cf\u3002<\/p>\n<p>1\u3001\u4e0b\u8f7d\u5b98\u65b9\u955c\u50cf\u4e2d\u7684\u542f\u52a8\u811a\u672c<\/p>\n<p>\u4ece https:\/\/github.com\/CollaboraOnline\/Docker-CODE\/blob\/master\/scripts\/start-libreoffice.sh \u4e0b\u8f7d\u542f\u52a8\u811a\u672c\uff0c\u653e\u5230scripts\u76ee\u5f55\u4e2d<\/p>\n<p>2\u3001\u51c6\u5907\u9700\u8981\u6dfb\u52a0\u7684\u5b57\u4f53<\/p>\n<p>\u5c06\u9700\u8981\u6dfb\u52a0\u7684\u5b57\u4f53\u653e\u5230windows\u76ee\u5f55\u4e2d<\/p>\n<p>3\u3001\u7f16\u5199Dockerfile\u6587\u4ef6<\/p>\n<pre class=\"lang:default decode:true \">FROM centos:7\r\n\r\n# \u8fd9\u91cc\u6539\u6210\u4f60\u81ea\u5df1\u7684\u57df\u540d\uff0c\u53ef\u6539\u53ef\u4e0d\u6539\r\nENV domain office.actom.me\r\n\r\n#\u6dfb\u52a0CODE\u7684yum\u6e90\r\nRUN rpm --import https:\/\/www.collaboraoffice.com\/repos\/CollaboraOnline\/CODE-centos7\/repodata\/repomd.xml.key\r\nRUN yum-config-manager --add-repo https:\/\/www.collaboraoffice.com\/repos\/CollaboraOnline\/CODE-centos7\r\n\r\nRUN yum update -y\r\n\r\n#centos\u9ed8\u8ba4\u955c\u50cf\u4e2d\u7684glibc\u662f\u7cbe\u7b80\u8fc7\u7684\uff0c\u9700\u8981\u91cd\u65b0\u5b89\u88c5\r\nRUN yum reinstall glibc glibc-common -y\r\n#\u5b89\u88c5CODE\r\nRUN yum install loolwsd CODE-brand -y\r\n#\u5b89\u88c5\u542f\u52a8\u811a\u672c\u4f9d\u8d56\u7684\u5e93\r\nRUN yum install -y openssl perl \r\n#\u5b89\u88c5\u6587\u6cc9\u8bd1\u5b57\u4f53\r\nRUN yum install -y wqy-*\r\n\r\n#\u6dfb\u52a0\u5b57\u4f53\u5230\u7cfb\u7edf\u6307\u5b9a\u76ee\u5f55\r\nADD windows \/usr\/share\/fonts\/windows\r\n#\u91cd\u5efa\u5b57\u4f53\u7f13\u5b58\r\nRUN fc-cache -fv\r\n\r\n#\u91cd\u70b9\uff01\/opt\/lool\/systemplate\u76ee\u5f55\u4e0b\u9700\u8981\u5c06\u5b57\u4f53\u76f8\u5173\u7684\u51e0\u4e2a\u6587\u4ef6\u5939\u91cd\u65b0\u7528\u955c\u50cf\u4e2d\u7684\u5bf9\u5e94\u6587\u4ef6\u5939\u8986\u76d6\uff0c\u5426\u5219\u5b57\u4f53\u5217\u8868\u4f1a\u6709\u8fd9\u4e2a\u5b57\u4f53\uff0c\u4f46\u662f\u5b9e\u9645\u4e0a\u4e0d\u751f\u6548\r\nRUN rm -rf \/opt\/lool\/systemplate\/var\/cache\/fontconfig\/*\r\nRUN cp \/var\/cache\/fontconfig\/* \/opt\/lool\/systemplate\/var\/cache\/fontconfig\r\nRUN ln -s \/usr\/share\/fonts\/* \/opt\/lool\/systemplate\/usr\/share\/fonts\r\nRUN rm -rf \/opt\/lool\/systemplate\/etc\/fonts\r\nRUN cp -R \/etc\/fonts\/ \/opt\/lool\/systemplate\/etc\/fonts\r\n\r\n# \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u4e3a\u4e2d\u6587\u73af\u5883\r\nRUN localedef -c -i zh_CN -f UTF-8 zh_CN.UTF-8\r\nENV LC_CTYPE zh_CN.UTF-8\r\nENV LC_ALL zh_CN.UTF-8\r\nENV LANG zh_CN.UTF-8\r\nADD scripts\/start-libreoffice.sh \/\r\n\r\n# Entry point\r\nCMD \/bin\/bash \/start-libreoffice.sh\r\n<\/pre>\n<p>4\u3001\u751f\u6210Docker\u955c\u50cf\u5e76\u8fd0\u884c<\/p>\n<pre class=\"lang:default decode:true \">docker build -t actom\/code:1.0 .\r\ndocker run --name office -t -d -p 127.0.0.1:9980:9980 -e 'domain=cloud\\\\.actom\\\\.me' --restart always --cap-add MKNOD actom\/code:1.0<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Collabora CODE \u7684 Docker\u955c\u50cf\u5b89\u88c5\u5e76\u542f\u52a8\u540e\uff0c\u9ed8\u8ba4\u4e2d\u6587\u5b57\u4f53\u53ea\u5e26 &#8230; <a class=\"more-link\" href=\"https:\/\/actom.me\/blog\/collabora-code-%e5%a2%9e%e5%8a%a0%e5%ad%97%e4%bd%93.html\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/posts\/1254"}],"collection":[{"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/comments?post=1254"}],"version-history":[{"count":1,"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/posts\/1254\/revisions"}],"predecessor-version":[{"id":1255,"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/posts\/1254\/revisions\/1255"}],"wp:attachment":[{"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/media?parent=1254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/categories?post=1254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/tags?post=1254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}