forked from typcn/Blogile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-java7+ssh
34 lines (27 loc) · 1.09 KB
/
Dockerfile-java7+ssh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# VERSION 0.0.1
# 默认ubuntu server长期支持版本
FROM ubuntu
# 签名啦
MAINTAINER pingod "[email protected]"
# 更新源,安装ssh server
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe"> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y openssh-server
RUN mkdir -p /var/run/sshd
# 设置root ssh远程登录密码为1614158300
RUN echo "root:1614158300" | chpasswd
# 添加orache java7源,一次性安装vim,wget,curl,java7,tomcat7等必备软件
RUN apt-get install python-software-properties
RUN add-apt-repository ppa:webupd8team/java
RUN apt-get update
RUN apt-get install -y vim wget curl oracle-java7-installer tomcat7
# 设置JAVA_HOME环境变量
RUN update-alternatives --display java
RUN echo "JAVA_HOME=/usr/lib/jvm/java-7-oracle">> /etc/environment
RUN echo "JAVA_HOME=/usr/lib/jvm/java-7-oracle">> /etc/default/tomcat7
# 容器需要开放SSH 22端口
EXPOSE 22
# 容器需要开放Tomcat 8080端口
EXPOSE 8080
# 设置Tomcat7初始化运行,SSH终端服务器作为后台运行
ENTRYPOINT service tomcat7 start && /usr/sbin/sshd -D