1.从jexus官网下载最新版本的jexus,要是专业版的,解压到jexus目录下。default目录里面放的是网站文件。
Dockerfile
#base image FROM centos # MAINTAINER MAINTAINER zzzili@qq.com # 拷贝jexus目录下所有内容到/usr目录下 COPY jexus /usr/jexus/ # 拷贝default目录下内容到网站根目录下 COPY default /var/www/default/ # 拷贝init.sh启动文件 ADD init.sh /bin RUN chmod +x /bin/init.sh; # 设置工作目录 WORKDIR /usr/jexus EXPOSE 80 ENTRYPOINT ["/bin/init.sh"]
init.sh
#!/bin/bash # Stop your services function stop_svc { /usr/jexus/jws stop >/dev/null 2>&1 service ssh stop >dev/null 2>&1 exit } # Set the SIGTREM signal response function trap 'stop_svc' SIGTERM # Start Your Services ##################### /usr/jexus/jws start # Waiting signal #################### while true do sleep 2 done
目录结构: