Dockerfile—Cachecloud

通过dockerfile快速部署cachecloud——redis集群管理
 
FROM centos:6.6
COPY cachecloud.sql /opt
ADD jdk-7u79-linux-x64.tar.gz /usr/local/
ADD apache-maven-3.3.9-bin.tar.gz /usr/local/
ADD soft.tar.gz /opt
ADD cachecloud-web.tar.gz /opt
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    echo "Asia/shanghai" >> /etc/timezone && \
yum install passwd openssl openssh-server openssh-clients -y && \
echo 'admin123' | passwd --stdin root && \
sed -i '/^session\s\+required\s\+pam_loginuid.so/s/^/#/' /etc/pam.d/sshd && \
WORKDIR /opt/soft/cachecloud
ENV JAVA_HOME /usr/local/jdk1.7.0_79
ENV JRE_HOME $JAVA_HOME/jre
ENV CLASSPATH .:$JAVA_HOME/lib:$JRE_HOME/lib
ENV PATH $PATH:$JAVA_HOME/bin
ENV MVN_HOME /usr/local/apache-maven-3.3.9
ENV JRE_mvn $MVN_HOME/jre
ENV PATH $PATH:$MVN_HOME/bin
#RUN yum install -y mysql-server mysql
#RUN /etc/init.d/mysqld start &&\
# mysql -e "grant all privileges on *.* to 'root'@'%' identified by '123456';"&&\
# mysql -e "grant all privileges on *.* to 'root'@'localhost' identified by '123456';"&&\
# mysql -uroot -p123456 -e "grant all privileges on *.* to 'admin'@'%' identified by 'admin';"&&\
# mysql -uroot -p123456 -e "grant all privileges on *.* to 'admin'@'localhost' identified by 'admin';"&&\
# mysql -uroot -p123456 -e "CREATE DATABASE cachecloud DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;"&&\
# mysql -uroot -p123456 cachecloud < /opt/cachecloud.sql

RUN mvn clean compile install -Ponline && \
cp /opt/soft/cachecloud/cachecloud-open-web/target/cachecloud-open-web-1.0-SNAPSHOT.war /opt/cachecloud-web && \
cp /opt/soft/cachecloud/cachecloud-open-web/src/main/resources/cachecloud-web.conf /opt/cachecloud-web && \
ln -s /opt/cachecloud-web/cachecloud-open-web-1.0-SNAPSHOT.war /etc/init.d/cachecloud-web

RUN rpm -ivh [url]http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm[/url] RUN yum install -y supervisor
RUN mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisord.conf
EXPOSE 22 8585 9999
CMD ["/usr/bin/supervisord"]

0 个评论

要回复文章请先登录注册