因为应用容器化部署已经是标准化的流程,无需再详篇介绍具体的部署流程。所以本文只提供相关的配置文档。如果对部署过程不了解的同学,请先自学容器基础。
镜像已经创建好了,如下

docker.io/xhuaustc/confluence:6.7.1
docker.io/xhuaustc/atlassian-mysql:5.7

镜像构建配置

mysql镜像

# my.cnf
[mysqld]# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links = 0# http://www.percona.com/blog/2008/05/31/dns-achilles-heel-mysql-installation/
skip_name_resolve# http://www.chriscalender.com/ignoring-the-lostfound-directory-in-your-datadir/
ignore-db-dir=lost+foundcharacter_set_server=utf8
init_connect='SET NAMES utf8'
collation_server=utf8_bin
transaction_isolation='read-committed'!includedir /etc/my.cnf.d
# Dockerfile
FROM centos/mysql-57-centos7
COPY my.cnf /etc/my.cnf

confluence镜像

git clone https://github.com/cptactionhank/docker-atlassian-confluence

在Dockerfile目录下添加server.xml, setenv.sh与atlassian-extras-decoder-v2-3.3.0.jar

# server.xml
<?xml version="1.0"?>
<Server port="8000" shutdown="SHUTDOWN"><Service name="Tomcat-Standalone"><Connector port="8090" connectionTimeout="300000" redirectPort="8443" maxThreads="400" minSpareThreads="10" enableLookups="false" acceptCount="100" URIEncoding="UTF-8" protocol="org.apache.coyote.http11.Http11NioProtocol"/><Engine name="Standalone" defaultHost="localhost"><Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false" startStopThreads="4"><Context path="" docBase="../confluence" reloadable="false" useHttpOnly="true"><!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties --><Manager pathname=""/><Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="600"/></Context><Context path="${confluence.context.path}/synchrony-proxy" docBase="../synchrony-proxy" reloadable="false" useHttpOnly="true"><Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="600"/></Context></Host></Engine><!--To run Confluence via HTTPS:* Uncomment the Connector below* Execute:%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  (Unix)with a password value of "changeit" for both the certificate and the keystore itself.* Restart and visit https://localhost:8443/For more info, see https://confluence.atlassian.com/display/DOC/Running+Confluence+Over+SSL+or+HTTPS--><!--<Connector port="8443" maxHttpHeaderSize="8192"maxThreads="150" minSpareThreads="25"protocol="org.apache.coyote.http11.Http11NioProtocol"enableLookups="false" disableUploadTimeout="true"acceptCount="100" scheme="https" secure="true"clientAuth="false" sslProtocols="TLSv1,TLSv1.1,TLSv1.2" sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2" SSLEnabled="true"URIEncoding="UTF-8" keystorePass="<MY_CERTIFICATE_PASSWORD>"/>
--></Service>
</Server>
# setenv.sh
# See the CATALINA_OPTS below for tuning the JVM arguments used to start Confluence.echo "If you encounter issues starting up Confluence, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide"# set the location of the pid file
if [ -z "$CATALINA_PID" ] ; thenif [ -n "$CATALINA_BASE" ] ; thenCATALINA_PID="$CATALINA_BASE"/work/catalina.pidelif [ -n "$CATALINA_HOME" ] ; thenCATALINA_PID="$CATALINA_HOME"/work/catalina.pidfi
fi
export CATALINA_PIDPRGDIR=`dirname "$0"`
if [ -z "$CATALINA_BASE" ]; thenif [ -z "$CATALINA_HOME" ]; thenLOGBASE=$PRGDIRLOGTAIL=..elseLOGBASE=$CATALINA_HOMELOGTAIL=.fi
elseLOGBASE=$CATALINA_BASELOGTAIL=.
fiPUSHED_DIR=`pwd`
cd $LOGBASE
cd $LOGTAIL
LOGBASEABS=`pwd`
cd $PUSHED_DIRecho ""
echo "Server startup logs are located in $LOGBASEABS/logs/catalina.out"
# IMPORTANT NOTE: Only set JAVA_HOME or JRE_HOME above this line
# Get standard Java environment variables
if $os400; then# -r will Only work on the os400 if the files are:# 1. owned by the user# 2. owned by the PRIMARY group of the user# this will not work if the user belongs in secondary groups. "$CATALINA_HOME"/bin/setjre.sh
elseif [ -r "$CATALINA_HOME"/bin/setjre.sh ]; then. "$CATALINA_HOME"/bin/setjre.shelseecho "Cannot find $CATALINA_HOME/bin/setjre.sh"echo "This file is needed to run this program"exit 1fi
fiecho "---------------------------------------------------------------------------"
echo "Using Java: $JRE_HOME/bin/java"
CONFLUENCE_CONTEXT_PATH=`$JRE_HOME/bin/java -jar $CATALINA_HOME/bin/confluence-context-path-extractor.jar $CATALINA_HOME`
export CONFLUENCE_CONTEXT_PATH
$JRE_HOME/bin/java -jar $CATALINA_HOME/bin/synchrony-proxy-watchdog.jar $CATALINA_HOME
echo "---------------------------------------------------------------------------"
JVM_MINIMUM_MEMORY=${JVM_XMS:-384m}
JVM_MAXIMUM_MEMORY=${JVM_XMX:-768m}# Set the JVM arguments used to start Confluence. For a description of the options, see
# http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
CATALINA_OPTS="-Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY} -XX:-PrintGCDetails -XX:+PrintGCDateStamps -XX:-PrintTenuringDistribution ${CATALINA_OPTS}"
CATALINA_OPTS="-Xloggc:$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M ${CATALINA_OPTS}"
CATALINA_OPTS="-XX:G1ReservePercent=20 ${CATALINA_OPTS}"
CATALINA_OPTS="-Djava.awt.headless=true ${CATALINA_OPTS}"
CATALINA_OPTS="-Datlassian.plugins.enable.wait=300 ${CATALINA_OPTS}"
CATALINA_OPTS="-Dsynchrony.enable.xhr.fallback=true ${CATALINA_OPTS}"
CATALINA_OPTS="-Dorg.apache.tomcat.websocket.DEFAULT_BUFFER_SIZE=32768 ${CATALINA_OPTS}"
CATALINA_OPTS="${START_CONFLUENCE_JAVA_OPTS} ${CATALINA_OPTS}"
CATALINA_OPTS="-Dconfluence.context.path=${CONFLUENCE_CONTEXT_PATH} ${CATALINA_OPTS}"export CATALINA_OPTS

修改Dockerfile

# Dockerfile
FROM openjdk:8-alpine# Setup useful environment variables
ENV CONF_HOME     /var/atlassian/confluence
ENV CONF_INSTALL  /opt/atlassian/confluence
ENV CONF_VERSION  6.7.1ENV JAVA_CACERTS  $JAVA_HOME/jre/lib/security/cacerts
ENV CERTIFICATE   $CONF_HOME/certificate# Install Atlassian Confluence and helper tools and setup initial home
# directory structure.
RUN set -x \&& apk --no-cache add curl xmlstarlet bash ttf-dejavu libc6-compat \&& mkdir -p                "${CONF_HOME}" \&& chmod -R 777            "${CONF_HOME}" \&& mkdir -p                "${CONF_INSTALL}/conf" \&& curl -Ls                "https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-${CONF_VERSION}.tar.gz" | tar -xz --directory "${CONF_INSTALL}" --strip-components=1 --no-same-owner \&& curl -Ls                "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.44.tar.gz" | tar -xz --directory "${CONF_INSTALL}/confluence/WEB-INF/lib" --strip-components=1 --no-same-owner "mysql-connector-java-5.1.44/mysql-connector-java-5.1.44-bin.jar" \&& chmod -R 777            "${CONF_INSTALL}/conf" \&& chmod -R 777            "${CONF_INSTALL}/temp" \&& chmod -R 777            "${CONF_INSTALL}/logs" \&& chmod -R 777            "${CONF_INSTALL}/work" \&& echo -e                 "\nconfluence.home=$CONF_HOME" >> "${CONF_INSTALL}/confluence/WEB-INF/classes/confluence-init.properties" \&& xmlstarlet              ed --inplace \--delete               "Server/@debug" \--delete               "Server/Service/Connector/@debug" \--delete               "Server/Service/Connector/@useURIValidationHack" \--delete               "Server/Service/Connector/@minProcessors" \--delete               "Server/Service/Connector/@maxProcessors" \--delete               "Server/Service/Engine/@debug" \--delete               "Server/Service/Engine/Host/@debug" \--delete               "Server/Service/Engine/Host/Context/@debug" \"${CONF_INSTALL}/conf/server.xml" \&& touch -d "@0"           "${CONF_INSTALL}/conf/server.xml" # Use the default unprivileged account. This could be considered bad practice
# on systems where multiple processes end up being executed by 'daemon' but
# here we only ever run one process anyway.# Expose default HTTP connector port.
EXPOSE 8090 8091# Set volume mount points for installation and home directory. Changes to the
# home directory needs to be persisted as well as parts of the installation
# directory due to eg. logs.
VOLUME ["/var/atlassian/confluence", "/opt/atlassian/confluence/logs"]# Set the default working directory as the Confluence home directory.
WORKDIR /var/atlassian/confluenceCOPY docker-entrypoint.sh /
COPY atlassian-extras-decoder-v2-3.3.0.jar /opt/atlassian/confluence/confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.3.0.jar
COPY server.xml /opt/atlassian/confluence/conf/server.xml
ENTRYPOINT ["/docker-entrypoint.sh"]# Run Atlassian Confluence as a foreground process by default.
CMD ["/opt/atlassian/confluence/bin/start-confluence.sh", "-fg"]

docker-compose配置

因为mysql用mysql用户启动的,需要把data/mysql权限改为777
chmod 777 data/mysql -R

wiki:image: xhuaustc/confluence:6.7.1restart: alwaysenvironment:- JVM_XMX=1024m- JVM_XMS=512mports:- '10380:8090'links:- dbvolumes:- ./data/confluence:/var/atlassian/confluence- ./data/logs:/opt/atlassian/confluence/logsdb:image: xhuaustc/atlassian-mysql:5.7restart: alwaysenvironment:- MYSQL_USER=confluence- MYSQL_PASSWORD=conflence- MYSQL_DATABASE=confluence- MYSQL_ROOT_PASSWORD=confluencevolumes:- ./data/mysql:/var/lib/mysql

Openshfit confluence模板

apiVersion: v1
kind: Template
metadata:creationTimestamp: nullname: confluence
objects:
- apiVersion: v1kind: DeploymentConfigmetadata:labels:run: confluencename: confluencespec:replicas: 1selector:run: confluencestrategy:type: Recreatetemplate:metadata:labels:run: confluencespec:containers:- env:- name: JVM_XMXvalue: '2048m'- name: JVM_XMSvalue: '1024m'image: docker.io/xhuaustc/confluence:6.7.1imagePullPolicy: IfNotPresentname: confluencevolumeMounts:- mountPath: /var/atlassian/confluencename: volume-7iy6x- mountPath: /opt/atlassian/confluence/logsname: volume-zsylyvolumes:- name: volume-7iy6xpersistentVolumeClaim:claimName: confluence- name: volume-zsylypersistentVolumeClaim:claimName: logtriggers:- type: ConfigChange
- apiVersion: v1kind: DeploymentConfigmetadata:labels:run: mysqlname: mysqlspec:replicas: 1selector:run: mysqlstrategy:type: Recreatetemplate:metadata:labels:run: mysqlspec:containers:- env:- name: MYSQL_USERvalue: confluence- name: MYSQL_PASSWORDvalue: confluence- name: MYSQL_DATABASEvalue: confluence- name: MYSQL_ROOT_PASSWORDvalue: confluenceimage: docker.io/xhuaustc/atlassian-mysql:5.7imagePullPolicy: IfNotPresentname: mysqlvolumeMounts:- mountPath: /var/lib/mysqlname: volume-uiwfavolumes:- name: volume-uiwfapersistentVolumeClaim:claimName: mysql-datatriggers:- type: ConfigChange
- apiVersion: v1kind: Servicemetadata:labels:run: confluencename: confluencespec:ports:- port: 8090protocol: TCPtargetPort: 8090selector:run: confluencetype: ClusterIP
- apiVersion: v1kind: Servicemetadata:labels:run: mysqlname: mysqlspec:ports:- port: 3306protocol: TCPtargetPort: 3306selector:run: mysqltype: ClusterIP
- apiVersion: v1kind: Routemetadata:annotations:haproxy.router.openshift.io/timeout: 3000slabels:run: confluencename: confluencespec:port:targetPort: 8090to:kind: Servicename: confluenceweight: 100wildcardPolicy: None
- apiVersion: v1kind: PersistentVolumeClaimmetadata:annotations:volume.beta.kubernetes.io/storage-class: ceph-rbd-scvolume.beta.kubernetes.io/storage-provisioner: kubernetes.io/rbdname: confluencespec:accessModes:- ReadWriteOnceresources:requests:storage: 20Gi
- apiVersion: v1kind: PersistentVolumeClaimmetadata:annotations:volume.beta.kubernetes.io/storage-class: ceph-rbd-scvolume.beta.kubernetes.io/storage-provisioner: kubernetes.io/rbdname: logspec:accessModes:- ReadWriteOnceresources:requests:storage: 10Gi
- apiVersion: v1kind: PersistentVolumeClaimmetadata:annotations:volume.beta.kubernetes.io/storage-class: ceph-rbd-scvolume.beta.kubernetes.io/storage-provisioner: kubernetes.io/rbdname: mysql-dataspec:accessModes:- ReadWriteOnceresources:requests:storage: 10Gi

作者:潘晓华Michael
链接:https://www.jianshu.com/p/e1e8b29affc0
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

docker部署confluence相关推荐

  1. 基于Docker的Confluence安装

    前言 Confluence是一个专业的企业知识管理与协同软件,也可以用于构建企业wiki.使用简单,但它强大的编辑和站点管理特征能够帮助团队成员之间共享信息.文档协作.集体讨论,信息推送. 我们实验室 ...

  2. confluence创建页面加载缓慢_树莓派4B使用docker安装confluence

    说明 confluence是一个专业的企业知识管理与协同软件,可以用于构建企业wiki.通过它可以实现团队成员之间的协作和知识共享.现在大多数公司都会部署一套confluence,用作内部wiki.另 ...

  3. 推荐一款基于docker部署的个人免费笔记工具wiznote

    推荐一款基于docker部署的个人免费笔记工具wiznote 作为一个爱写作爱折腾的程序员,在做某个事情的时候,脑子里总是会联想并且不断蹦出各种奇怪的创意和想法,但是这些想法很多时候都是一闪而逝,事情 ...

  4. 使用docker-compose部署confluence,自己的wiki

    一.搭建过程 1.1 基础准备 1.1.1 拉取docker镜像,我们选择的版本是 6.15.1-alpine mkdir ./confluence cd ./confluence docker pu ...

  5. FreeSwitch的docker部署

    Docker部署FS是一种非常好的选择.而且FS本身就提供了支持. 在FS源码包里,有一个名为docker的子目录: 进入这个目录,可以看到三个子目录和一个说明文档README: base_image ...

  6. Docker部署JiraConfluence

    Docker部署Jira&Confluence Uninstall docker Install yum tools Add repo to profile Install docker St ...

  7. Docker 部署 SpringBoot 项目整合 Redis 镜像做访问计数Demo

    Docker 部署SpringBoot项目整合 Redis 镜像做访问计数Demo 最终效果如下 大概就几个步骤 1.安装 Docker CE 2.运行 Redis 镜像 3.Java 环境准备 4. ...

  8. Docker 部署SpringBoot项目不香吗?

    点击上方"方志朋",选择"设为星标" 回复"666"获取新整理的面试文章 作者:流星007 链接:toutiao.com/i68433912 ...

  9. docker部署springboot_Docker+SpringBoot快速构建和部署应用

    前言 Docker技术发展为当前流行的微服务提供了更加便利的环境,使用SpringBoot+Docker部署和发布应用,其实也是一件比较简单的事情.当前,前提是得有Docker的基础. 构建一个Spr ...

最新文章

  1. DDoS高防服务如何选择?
  2. 吃鸡服务器不接受响应,绝地求生:蓝洞优化服务器性能,从此告别掉帧延迟!...
  3. 百度地图根据经纬度获取地址
  4. Java 处理空指针异常(java.lang.NullPointerException)空比较
  5. 机器学习实战——Logistic回归
  6. linux r语言 安装包下载,R语言安装程序包(示例代码)
  7. 基于Java+Spring+mybatis+vue+element实现酒店管理系统
  8. 预测模型(数学建模)
  9. Android gpuimage美颜滤镜,基于GPUImage的实时美颜滤镜
  10. 动态规划--背包计数--hdu2079选课时间
  11. 没有人脉如何靠内推进大厂?内推真的那么神吗?带你搞透内推到底是什么
  12. tp房产源码tpfangchan-fangcms-tphouse火车头采集软件方法
  13. python 爬取http://www.weather.com.cn/中国主要城市周边城市的天气
  14. 盖高辛氏衰,天下归之
  15. python和stata哪个数据分析实例,STATA数据分析案例:Zoutendijk可行方向法
  16. 黑科技编程开发,利用Python使图片完美去除水印
  17. Mac OS 系统用不了Origin怎么办?
  18. 四川2021年高考成绩等位分查询,2019年四川高考等位分查询,志愿填报更精准!...
  19. U盘启动盘重装win7/10系统
  20. 打造最小的DirectX安装程序

热门文章

  1. 【已解决】华硕天选rtx2060安装Ubuntu20黑屏问题
  2. NRZ、NRZI编码
  3. 各种编程语言的优缺点
  4. 第一次使用github
  5. 微信小程序制作页面内导航栏
  6. 融合通信售前糗事大集锦,你中了几条!
  7. Java反射高频面试题(附答案)
  8. OL4中styleFunction的妙用
  9. 付睿ucla_UCLA库如何通过开放源代码保留稀有对象
  10. XMPP学习(一)smack类库的使用及XMPP的了解