FROM apaas/edas-centos-openjdk8-alitomcat7:latest
MAINTAINER Alibaba Cloud EDAS Teamedas-dev@list.alibaba-inc.com
ENV APP_NAME bsopconsole
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo ‘Asia/Shanghai’ >/etc/timezone
auth
RUN groupadd admin && useradd -m -g admin admin
RUN rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/taobao-tomcat-7.0.68.1-665507.alios7.noarch.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/ali-jdk-8.3.6-1207901.el7.x86_64.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/taobao-cronolog-1.6.2-15.alios7.x86_64.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/tengine-proxy-2.4.5-20200630135717.el7u2.x86_64.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/c_tbip-2.0.12-1756476.ba44bab.el7.x86_64.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/aria2-1.18.10-2.alios7.1.x86_64.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/taobao-JMagick-6.8.6-1.alios7.x86_64.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/taobao-ImageMagick-6.8.12-1693457.alios7.x86_64.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/taobao-imagecolor-2.0.1-4.alios7.x86_64.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/t-midware-vipserver-dnsclient-1.1.6-1789317.alios7.noarch.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/rsync-3.1.0-1.x86_64.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/sudo-1.8.19p2-11.alios7.x86_64.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/less-458-9.1.alios7.x86_64.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/which-2.20-7.1.alios7.x86_64.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/tsar-2.1.33-1568425.82ced85.el7.x86_64.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/crontabs-1.11.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/cronie-1.4.11.rpm” &&
rpm -ivh --nodeps “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/rpm/sunfire-agent-1.0.11-20200518191308.noarch.rpm”
RUN mkdir -p /home/admin/bsopconsole/target/
RUN wget -qO /home/admin/bsopconsole/target/taobao-hsf.tgz “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/tgz/taobao-hsf.tgz”
检验sar包md5是否正确
RUN localMd5=md5sum /home/admin/$APP_NAME/target/taobao-hsf.tgz | awk '{print $1}'
;
if [ “58a91b2d72b22ed8176973ed3bc86476” != “$localMd5” ]; then
echo “taobao-hsf.sar md5 check failed! expect $onlineMd5, but $localMd5”;
exit 1;
fi
RUN mkdir -p /home/admin/bsopconsole/ &&
wget -qO - https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/tgz/bsopconsole_2016-05-25-15-54-14_1464162854867_app_init_tao.tgz | tar -C /home/admin/bsopconsole/ -zxf -
RUN mkdir -p /home/admin/cai/ &&
wget -qO - “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/tgz/bsopconsole_2016-05-25-15-54-14_1464162854867_cai_init_tao.tgz” | tar -C /home/admin/cai/ -zxf -
RUN wget -qO - “https://security-dirac.oss-cn-zhangjiakou.aliyuncs.com/common/tgz/bsopconsole_2016-05-25-15-54-14_1464162854867_gen_init_tao.tgz” | tar -C /home/admin/ -zxf -
RUN echo “sudo /home/a/vipsrv-dns/bin/vipsrv enable” >> /home/admin/start.sh &&
echo “sudo /home/a/vipsrv-dns/bin/vipsrv restart” >> /home/admin/start.sh &&
echo “sudo /home/admin/stunnel/bin/stunnel /home/admin/stunnel/etc/stunnel/stunnel-aliyun-bsop.conf” >> /home/admin/start.sh &&
echo “/home/admin/bsopconsole/bin/jbossctl restart” >> /home/admin/start.sh &&
echo “tail -f /dev/null” >> /home/admin/start.sh && \
echo " /home/admin/bsopconsole/bin/jbossctl stop" > /home/admin/stop.sh &&
echo “/home/admin/bsopconsole/bin/preload.sh” > /home/admin/health.sh
COPY environment/common/app/bin/setenv.sh /home/admin/bsopconsole/bin/
COPY environment/common/app/bin/preload.sh /home/admin/bsopconsole/bin/
COPY environment/common/app/bin/appctl.sh /home/admin/bsopconsole/bin/
COPY environment/cai/conf/ /home/admin/cai/conf/
COPY environment/tomcat/conf/ /opt/taobao/tomcat/conf/
COPY environment/stunnel/stunnel-bsop.tar.gz /home/admin/
COPY start_sunfire.sh /home/admin/
COPY app.tgz /home/admin/bsopconsole/target/bsopconsole.tgz
设置文件夹操作权限
RUN chmod -R a+x /home/admin/bsopconsole/bin/
RUN chmod +x /home/admin/*.sh
启动容器时进入的工作目录
WORKDIR /home/admin
RUN tar -zxvf /home/admin/stunnel-bsop.tar.gz -C /home/admin/
VOLUME /home/admin/vipsrv-failover /home/admin/vipsrv-cache
VOLUME /home/admin/logs /home/admin/bsopconsole/logs /home/admin/cai/logs
CMD chown -R admin:admin /home/admin/; sh /home/admin/start_sunfire.sh; su admin -c /home/admin/start.sh