Public Repository

Last pushed: 2 years ago
Short Description
supervisor+ssh+jdk+tomcat7
Full Description

##supervisor+ssh+jdk+tomcat7

###Dockerfile:
FROM ubuntu:12.04
MAINTAINER "xxxx"

RUN apt-get update -y
RUN apt-get install wget tar openssh-server supervisor openjdk-7-jdk -y
RUN wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.47/bin/apache-tomcat-7.0.47.tar.gz
RUN tar -xvf apache-tomcat-7.0.47.tar.gz
RUN mv apache-tomcat-7.0.47 /usr/local/
COPY tomcat747 /etc/init.d/tomcat747
RUN chmod 755 /etc/init.d/tomcat747

RUN mkdir -p /var/run/sshd
RUN mkdir -p /var/log/supervisor

RUN echo "root:xxx" | chpasswd
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

EXPOSE 22
EXPOSE 8080
CMD ["/usr/bin/supervisord"]

###启动脚本:

#!/bin/bash
export CATALINA_HOME=/usr/local/apache-tomcat-7.0.47
PATH=/sbin:/bin:/usr/sbin:/usr/bin
start() {
sh $CATALINA_HOME/bin/startup.sh
}
stop() {
sh $CATALINA_HOME/bin/shutdown.sh
}
case $1 in
start|stop) $1;;
restart) stop; start;;
*) echo "Run as $0 <start|stop|restart>"; exit 1;;
esac

###supervisor配置:
[supervisord]
nodaemon=true
[program:sshd]
command=/usr/sbin/sshd -D

[program:tomcat]
command=/bin/bash -c "/etc/init.d/tomcat747 start"

export JAVA_HOME=/usr/lib/jvm/java-7-oracle
export PATH=$JAVA_HOME/bin:$PATH

Docker Pull Command
Owner
welision1986

Comments (0)