`

使用最小的base镜像Alpine

 
阅读更多
gliderlabs/alpine

SIZE = 5M

GithubUrl =  https://github.com/gliderlabs/docker-alpine




使用DockerFile脚本 安装 JDK7的 Alpine



# Pull base image  
FROM gliderlabs/alpine:3.2 
  
MAINTAINER SYL "784838898@qq.com"  
  
# update source  

  
# Install curl  
RUN apt-get -y install curl  
  
# Install JDK 7  
RUN cd /tmp &&  curl -L 'http://download.oracle.com/otn-pub/java/jdk/7u65-b17/jdk-7u65-linux-x64.tar.gz' -H 'Cookie: oraclelicense=accept-securebackup-cookie; gpw_e24=Dockerfile' | tar -xz  
RUN mkdir -p /usr/lib/jvm  
RUN mv /tmp/jdk1.7.0_65/ /usr/lib/jvm/java-7-oracle/  
  
# Set Oracle JDK 7 as default Java  
RUN update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-oracle/bin/java 300     
RUN update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-7-oracle/bin/javac 300     
  
ENV JAVA_HOME /usr/lib/jvm/java-7-oracle/  
  
# Install ssh
RUN apt-get install -y openssh-server  
RUN mkdir /var/run/sshd  
RUN echo 'root:rootroot' |chpasswd  
RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config  
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config  
EXPOSE 22 CMD ["/usr/sbin/sshd", "-D"]  
  
# Expose ports.  
EXPOSE 8080 8443 22
  
 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics